FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cli/python/codegen/codegen/code_builder.py at main · databricks/cli · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
databricks
/
cli
Public
Notifications
You must be signed in to change notification settings
Fork
215
Star
385
Code
Issues
87
Pull requests
180
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cli
/
python
/
codegen
/
codegen
/
code_builder.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
36 lines (24 loc) · 885 Bytes
Breadcrumbs
cli
/
python
/
codegen
/
codegen
/
code_builder.py
Copy path
File metadata and controls
36 lines (24 loc) · 885 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from
typing
import
TYPE_CHECKING
if
TYPE_CHECKING
:
from
typing_extensions
import
Self
class
CodeBuilder
:
def
__init__
(
self
):
self
.
_code
=
""
def
append
(
self
,
*
args
:
str
)
->
"Self"
:
for
arg
in
args
:
self
.
_code
+=
arg
return
self
def
indent
(
self
):
return
self
.
append
(
" "
)
def
newline
(
self
)
->
"Self"
:
return
self
.
append
(
"
\n
"
)
def
append_list
(
self
,
args
:
list
[
str
],
sep
:
str
=
","
)
->
"Self"
:
return
self
.
append
(
sep
.
join
(
args
))
def
append_dict
(
self
,
args
:
dict
[
str
,
str
],
sep
:
str
=
","
)
->
"Self"
:
return
self
.
append_list
([
f"
{
k
}
=
{
v
}
"
for
k
,
v
in
args
.
items
()],
sep
)
def
append_triple_quote
(
self
)
->
"Self"
:
return
self
.
append
(
'"""'
)
def
append_repr
(
self
,
value
)
->
"Self"
:
return
self
.
append
(
repr
(
value
))
def
build
(
self
):
return
self
.
_code
Back
|
FazBrowse Home
|
New Git URL