Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gridtk
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
software
gridtk
Commits
6a650e2e
There was a problem fetching the pipeline summary.
Commit
6a650e2e
authored
7 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
Fix python 3.x compatibility for 'jman ls'
parent
cd80b53e
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridtk/models.py
+3
-3
3 additions, 3 deletions
gridtk/models.py
with
3 additions
and
3 deletions
gridtk/models.py
+
3
−
3
View file @
6a650e2e
...
@@ -226,7 +226,7 @@ class Job(Base):
...
@@ -226,7 +226,7 @@ class Job(Base):
"""
Returns the command line for the job.
"""
"""
Returns the command line for the job.
"""
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 3, the command line is bytes, which can be pickled directly
# In python 3, the command line is bytes, which can be pickled directly
return
loads
(
self
.
command_line
)
if
isinstance
(
self
.
command_line
,
bytes
)
else
loads
(
str
(
self
.
command_line
))
return
loads
(
self
.
command_line
)
if
isinstance
(
self
.
command_line
,
bytes
)
else
loads
(
self
.
command_line
.
encode
(
))
def
set_command_line
(
self
,
command_line
):
def
set_command_line
(
self
,
command_line
):
"""
Sets / overwrites the command line for the job.
"""
"""
Sets / overwrites the command line for the job.
"""
...
@@ -244,14 +244,14 @@ class Job(Base):
...
@@ -244,14 +244,14 @@ class Job(Base):
"""
Returns the array arguments for the job; usually a string.
"""
"""
Returns the array arguments for the job; usually a string.
"""
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 3, the command line is bytes, which can be pickled directly
# In python 3, the command line is bytes, which can be pickled directly
return
loads
(
self
.
array_string
)
if
isinstance
(
self
.
array_string
,
bytes
)
else
loads
(
str
(
self
.
array_string
))
return
loads
(
self
.
array_string
)
if
isinstance
(
self
.
array_string
,
bytes
)
else
loads
(
self
.
array_string
.
encode
(
))
def
get_arguments
(
self
):
def
get_arguments
(
self
):
"""
Returns the additional options for the grid (such as the queue, memory requirements, ...).
"""
"""
Returns the additional options for the grid (such as the queue, memory requirements, ...).
"""
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 2, the command line is unicode, which needs to be converted to string before pickling;
# In python 3, the command line is bytes, which can be pickled directly
# In python 3, the command line is bytes, which can be pickled directly
args
=
loads
(
self
.
grid_arguments
)[
'
kwargs
'
]
if
isinstance
(
self
.
grid_arguments
,
bytes
)
else
loads
(
str
(
self
.
grid_arguments
))[
'
kwargs
'
]
args
=
loads
(
self
.
grid_arguments
)[
'
kwargs
'
]
if
isinstance
(
self
.
grid_arguments
,
bytes
)
else
loads
(
self
.
grid_arguments
.
encode
(
))[
'
kwargs
'
]
# in any case, the commands have to be converted to str
# in any case, the commands have to be converted to str
retval
=
{}
retval
=
{}
if
'
pe_opt
'
in
args
:
if
'
pe_opt
'
in
args
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment