Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
py-bake
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sds
py-bake
Commits
c2a9e75b
Commit
c2a9e75b
authored
Sep 28, 2018
by
Matthieu Dorier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
corrected encoding problem
parent
ef230617
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
pybake/target.py
pybake/target.py
+11
-6
No files found.
pybake/target.py
View file @
c2a9e75b
...
...
@@ -24,15 +24,18 @@ class BakeTargetID():
"""
if
(
self
.
_tid
is
None
):
return
str
(
None
)
return
str
(
_pybaketarget
.
target_id_to_string
(
self
.
_tid
))
byte_string
=
_pybaketarget
.
target_id_to_string
(
self
.
_tid
)
return
byte_string
.
decode
()
@
staticmethod
def
from_str
(
string
):
def
from_str
(
byte_
string
):
"""
Converts a string representation of the BakeTargetID into
a concrete BakeTargetID object.
"""
tid
=
_pybaketarget
.
target_id_from_string
(
str
(
string
))
if
(
isinstance
(
byte_string
,
str
)):
byte_string
=
byte_string
.
encode
()
tid
=
_pybaketarget
.
target_id_from_string
(
byte_string
)
if
(
tid
is
None
):
return
None
else
:
...
...
@@ -63,15 +66,17 @@ class BakeRegionID():
if
(
self
.
_rid
is
None
):
return
str
(
None
)
a
=
_pybaketarget
.
region_id_to_string
(
self
.
_rid
)
return
base64
.
b64encode
(
a
)
return
base64
.
b64encode
(
a
)
.
decode
()
@
staticmethod
def
from_str
(
string
):
def
from_str
(
byte_
string
):
"""
Converts a string representing a BakeRegionID into a concrete
BakeRegionID object.
"""
rid
=
_pybaketarget
.
region_id_from_string
(
base64
.
b64decode
(
str
(
string
)))
if
(
isinstance
(
byte_string
,
str
)):
byte_string
=
byte_string
.
encode
()
rid
=
_pybaketarget
.
region_id_from_string
(
base64
.
b64decode
(
byte_string
))
if
(
rid
is
None
):
return
None
else
:
...
...
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