Skip to content

Commit 12b1e1f

Browse files
committed
namedtuple is the name of a function in the collections module and not a module itself, so I fixed all the imports of that.
1 parent cd25815 commit 12b1e1f

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

drmaa/__init__.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
import ctypes as _ct
3131

3232
try:
33-
import namedtuple as _nt
33+
from collections import namedtuple
3434
except ImportError: # pre 2.6 behaviour
35-
import nt as _nt
35+
from drmaa.nt import namedtuple
3636

3737
__version__ = "$Revision$"[11:-2]
3838

@@ -68,10 +68,10 @@
6868
OutOfMemoryException,)
6969

7070
Version = _h.Version
71-
JobInfo = _nt.namedtuple("JobInfo",
71+
JobInfo = namedtuple("JobInfo",
7272
"""jobId hasExited hasSignal terminatedSignal
7373
hasCoreDump wasAborted exitStatus resourceUsage""")
74-
# FileTransferMode = _nt.namedtuple("FileTransferMode",
74+
# FileTransferMode = namedtuple("FileTransferMode",
7575
# """transferInputStream transferOutputStream
7676
# transferErrorStream""")
7777

@@ -359,7 +359,7 @@ def runBulkJobs(jobTemplate, beginIndex, endIndex, step):
359359
@staticmethod
360360
def control(jobId, operation):
361361
"""\
362-
Used to hold, release, suspend, resume, or kill the job identified by jobId.
362+
Used to hold, release, suspend, resume, or kill the job identified by jobId.
363363
364364
:Parameters:
365365
jobId : string
@@ -429,7 +429,7 @@ def synchronize(jobIds, timeout=-1, dispose=False):
429429
timeout has elapsed, all the jobs have been waited on or there was an
430430
interrupt. If the invocation exits on timeout, an ExitTimeoutException
431431
is thrown. The caller should check system time before and after this
432-
call in order to be sure of how much time has passed.
432+
call in order to be sure of how much time has passed.
433433
"""
434434
if dispose: d = 1
435435
else: d = 0
@@ -439,7 +439,7 @@ def synchronize(jobIds, timeout=-1, dispose=False):
439439
@staticmethod
440440
def wait(jobId, timeout=-1):
441441
"""\
442-
Wait for a job with jobId to finish execution or fail.
442+
Wait for a job with jobId to finish execution or fail.
443443
444444
:Parameters:
445445
`jobId` : str
@@ -449,7 +449,7 @@ def wait(jobId, timeout=-1):
449449
jobId, this routine will wait for any job from the session
450450
`timeout` : float
451451
The timeout value is used to specify the desired behavior when a
452-
result is not immediately available.
452+
result is not immediately available.
453453
454454
The value `Session.TIMEOUT_WAIT_FOREVER` may be specified to wait
455455
indefinitely for a result. The value `Session.TIMEOUT_NO_WAIT` may

drmaa/helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
_BUFLEN=const.ATTR_BUFFER
3030

3131
try:
32-
import namedtuple as _nt
32+
from collections import namedtuple
3333
except ImportError: # pre 2.6 behaviour
34-
import nt as _nt
34+
from drmaa.nt import namedtuple
3535

3636
class BoolConverter(object):
3737
"""Helper class to convert to/from bool attributes."""
@@ -66,7 +66,7 @@ def __get__(self, *args):
6666
c(self._f, buf, _ct.sizeof(buf))
6767
return buf.value
6868

69-
Version = _nt.namedtuple("Version", "major minor")
69+
Version = namedtuple("Version", "major minor")
7070
Version.__str__ = lambda x: "%s.%s" % (x.major, x.minor)
7171
#Version.__doc__ = """\
7272
#An object representing the DRMAA version.
@@ -105,7 +105,7 @@ def __set__(self, instance, value):
105105
c(drmaa_set_attribute, instance, self.name, v)
106106
def __get__(self, instance, _):
107107
attr_buffer = create_string_buffer(const.ATTR_BUFFER)
108-
c(drmaa_get_attribute, instance, self.name,
108+
c(drmaa_get_attribute, instance, self.name,
109109
attr_buffer, sizeof(attr_buffer))
110110
if self.converter:
111111
return self.converter.from_drmaa(attr_buffer.value)
@@ -114,7 +114,7 @@ def __get__(self, instance, _):
114114

115115
class VectorAttribute(object):
116116
"""\
117-
A DRMAA attribute representing a list.
117+
A DRMAA attribute representing a list.
118118
119119
To be managed with vector C DRMAA attribute management functions."""
120120
def __init__(self, name):

0 commit comments

Comments
 (0)