Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
104
Merge Requests
104
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
ce8e503d
Commit
ce8e503d
authored
Jan 09, 2024
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
51a45f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
18 deletions
+7
-18
software/ors-amarisoft/ru/xbuildout.py
software/ors-amarisoft/ru/xbuildout.py
+7
-18
No files found.
software/ors-amarisoft/ru/xbuildout.py
View file @
ce8e503d
...
...
@@ -19,7 +19,6 @@
- encode/decode convert string to/from form, that is suitable to be used in
names of buildout sections.
- XXX quote
"""
...
...
@@ -60,6 +59,13 @@
#
# # referring to <ru_ref>-stats
# ${ {{-B('%s-stats' % ru_ref)}}:output}
#
#
# See also `dumps` in buildout for a way to serialize option values with
# protection against code injection:
#
# https://lab.nexedi.com/nexedi/slapos.buildout/commit/4e13dcb9
# https://lab.nexedi.com/nexedi/slapos.recipe.template/commit/84dc7957
def
encode
(
s
:
str
)
->
str
:
s
=
s
.
encode
(
'utf-8'
)
outv
=
[]
...
...
@@ -128,18 +134,6 @@ def _decode(s):
return
out
## quote converts string s into quoted form with all buildout control characters escaped... XXX
## XXX -> pyquote?
#def quote(s: str) -> str:
# assert isinstance(s, str), type(s)
# 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))
# if r[1:-1] == s:
# return s # original string
# return '!py!' + r
# ----------------------------------------
import
re
...
...
@@ -198,8 +192,3 @@ def test_encode():
def
_
(
cause
):
assert
isinstance
(
cause
,
UnicodeDecodeError
)
checkbad
(
x
,
_
)
def
test_quote
():
# XXX
pass
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