QueueBase documentation¶
Base class and common code for dirq
package.
It is used internally by dirq
modules and should not
be used elsewhere.
Author¶
Konstantin Skaburskas <konstantin.skaburskas@gmail.com>
License and Copyright¶
ASL 2.0
Copyright (C) CERN 2011-2016
-
class
dirq.QueueBase.
QueueBase
(path, umask=None, rndhex=None)¶ -
copy
()¶ Copy/clone the object. Return copy of the object.
Note:
- the main purpose is to copy/clone the iterator cached state
- the other structured attributes (including schema) are not cloned
-
first
()¶ Return the first element in the queue and cache information about the next ones.
- Raise:
- OSError - can’t list directories
-
names
()¶ Return iterator over element names.
-
next
()¶ Return name of the next element in the queue, only using cached information. When queue is empty, depending on the iterator protocol - return empty string or raise StopIteration.
- Return:
- name of the next element in the queue
- Raise:
- StopIteration - when used as Python iterator via
- __iter__() method
-
touch
(ename)¶ Touch an element directory to indicate that it is still being used.
- Note:
- this is only really useful for locked elements but we allow it for all.
- Raises:
- EnvironmentError - on any IOError, OSError in utime()
NOTE: this may not work on OSes with directories implemented not as files (eg. Windows). See doc for os.utime().
-