Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gridtk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bob
gridtk
Commits
f008c662
Commit
f008c662
authored
Aug 29, 2013
by
Manuel Günther
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tried to make the code python 3 compatible; removed (unnecessary) dependence on bob.
parent
5c26d3a3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
gridtk/local.py
gridtk/local.py
+1
-1
gridtk/models.py
gridtk/models.py
+7
-6
gridtk/tests/__init__.py
gridtk/tests/__init__.py
+1
-1
No files found.
gridtk/local.py
View file @
f008c662
...
...
@@ -143,7 +143,7 @@ class JobManagerLocal(JobManager):
"""Finalizes the execution of the job by writing the stdout and stderr results into the according log files."""
def
write
(
file
,
std
,
process
):
f
=
std
if
file
is
None
else
open
(
str
(
file
),
'w'
)
f
.
write
(
process
.
read
())
f
.
write
(
process
.
read
()
.
decode
(
'utf-8'
)
)
self
.
lock
()
# get the files to write to
...
...
gridtk/models.py
View file @
f008c662
import
sqlalchemy
from
sqlalchemy
import
Table
,
Column
,
Integer
,
String
,
Boolean
,
ForeignKey
from
bob.db.sqlalchemy_migration
import
Enum
,
relationship
from
sqlalchemy.orm
import
backref
from
sqlalchemy
import
Table
,
Column
,
Integer
,
String
,
Boolean
,
ForeignKey
,
Enum
from
sqlalchemy.orm
import
backref
,
relationship
from
sqlalchemy.ext.declarative
import
declarative_base
import
os
...
...
@@ -9,8 +8,10 @@ import sys
if
sys
.
version_info
[
0
]
>=
3
:
from
pickle
import
dumps
,
loads
python_3
=
True
else
:
from
cPickle
import
dumps
,
loads
python_3
=
False
from
.tools
import
logger
...
...
@@ -172,13 +173,13 @@ class Job(Base):
def
get_command_line
(
self
):
return
loads
(
str
(
self
.
command_line
))
return
loads
(
s
elf
.
command_line
)
if
python_3
else
loads
(
s
tr
(
self
.
command_line
))
def
get_array
(
self
):
return
loads
(
str
(
self
.
array_string
))
return
loads
(
s
elf
.
array_string
)
if
python_3
else
loads
(
s
tr
(
self
.
array_string
))
def
get_arguments
(
self
):
return
loads
(
str
(
self
.
grid_arguments
))
return
loads
(
s
elf
.
grid_arguments
)
if
python_3
else
loads
(
s
tr
(
self
.
grid_arguments
))
def
get_jobs_we_wait_for
(
self
):
return
[
j
.
waited_for_job
for
j
in
self
.
jobs_we_have_to_wait_for
if
j
.
waited_for_job
is
not
None
]
...
...
gridtk/tests/__init__.py
View file @
f008c662
...
...
@@ -173,7 +173,7 @@ class GridTKTest(unittest.TestCase):
jman
.
main
([
'./bin/jman'
,
'--database'
,
self
.
database
,
'list'
,
'--print-array-jobs'
])
print
()
# test that the
list command still
works
# test that the
report command
works
jman
.
main
([
'./bin/jman'
,
'--database'
,
self
.
database
,
'report'
])
# clean-up
...
...
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