Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos
Commits
48250338
Commit
48250338
authored
Jan 09, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
9c4c7a6b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
software/ors-amarisoft/ru/xbuildout.py
software/ors-amarisoft/ru/xbuildout.py
+7
-4
No files found.
software/ors-amarisoft/ru/xbuildout.py
View file @
48250338
...
@@ -87,7 +87,7 @@ def encode(s: str) -> str:
...
@@ -87,7 +87,7 @@ def encode(s: str) -> str:
# decode provides reverse operation for encode.
# decode provides reverse operation for encode.
def
decode
(
s
:
str
)
->
str
|
ValueError
:
def
decode
(
s
:
str
)
:
# -> str | ValueError
try
:
try
:
return
_decode
(
s
)
return
_decode
(
s
)
except
Exception
as
e
:
except
Exception
as
e
:
...
@@ -131,10 +131,13 @@ def _decode(s):
...
@@ -131,10 +131,13 @@ def _decode(s):
# quote converts string s into quoted form with all buildout control characters escaped... XXX
# quote converts string s into quoted form with all buildout control characters escaped... XXX
# XXX -> pyquote?
# XXX -> pyquote?
def
quote
(
s
:
str
)
->
str
:
def
quote
(
s
:
str
)
->
str
:
r
=
repr
(
s
)
assert
isinstance
(
s
,
str
),
type
(
s
)
for
c
in
'$[]{}
\
n
'
:
r
=
str
.
__repr__
(
s
)
# both str and markupsafe.Markup go as regular str
for
c
in
'$[]
\
n
'
:
r
=
r
.
replace
(
c
,
r'\
x%
02x'
%
ord
(
c
))
r
=
r
.
replace
(
c
,
r'\
x%
02x'
%
ord
(
c
))
return
r
if
r
[
1
:
-
1
]
==
s
:
return
s
# original string
return
'!py!'
+
r
# ----------------------------------------
# ----------------------------------------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment