Commit f008c662 authored by Manuel Günther's avatar Manuel Günther

Tried to make the code python 3 compatible; removed (unnecessary) dependence on bob.

parent 5c26d3a3
......@@ -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
......
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(self.command_line) if python_3 else loads(str(self.command_line))
def get_array(self):
return loads(str(self.array_string))
return loads(self.array_string) if python_3 else loads(str(self.array_string))
def get_arguments(self):
return loads(str(self.grid_arguments))
return loads(self.grid_arguments) if python_3 else loads(str(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]
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment