| |
- __builtin__.object
-
- InotifyDescriptor
- NEvent
- exceptions.Exception(exceptions.BaseException)
-
- InotifyError
class InotifyDescriptor(__builtin__.object) |
|
This class represents all inotify watch descriptors created for
the current session: it tracks the task id and path related and gets
notifications of any new task created during the lifetime of the session |
|
Methods defined here:
- __init__(self, SQLCon=None)
- If SQLCon (as instance of createdb.SQLConnection) exists, use this
connection handler and ignore the one provided by this module
- delete(self, tas_id=None, wd=None)
- Delete a given task from inotify watcher. If tas_id is null,
wd must be a dict and the wds contained there will be erased from
the database
- find(self)
- Returns a list of dicts containing new path and action flag
These values cannot have a wd assigned (unless the task is
canceled)
- insert(self, tas_id, tas_from)
- A new task has been created so there's a new path to watch.
- restart(self)
- When required, this function returns a list of tasks that need to
backup a.s.a. there are changes. We need to reload the watch class
with all the tasks with the required information.
No input parameters. Returns a list containing dicts, each one
containing the to-backup path (Task.tas_from) and the task id
- stop(self)
- In case of need, user can make the watcher stop smoothly. This
method will update inotify_descriptor.ind_flag to STOP and the
daemon -as soon as it read it- will stop.
- update(self, wd_dict)
- Update descriptors that were assigned a wd.
Parameters:
wd_dict: a dictionary containing 'path watched':['wd', [reserved],
[task(s)]]
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __table__ = 'inotify_descriptor'
- delete_flag = 1
- stop_flag = 0
|
class NEvent(__builtin__.object) |
|
This class represents all generated events from the watcher |
|
Methods defined here:
- __init__(self, id=None, **kwargs)
- If id is not null, get the given NEvent from the database.
If kwargs is null, init an empty instance (must be fill later with db
data). kwargs must map to columns in event table. If key "eve_tas_id"
is missing or None from kwargs, it will be retrieved from the database.
If it does not exist in there, the init will fail
- save(self)
- Save the given instance in the database: only for new events
Static methods defined here:
- pop(commit_=False, *min_max_eve)
- Return the existing records in the database, deleting them from
table. This method will return a list of instances each of them
representing a NEvent.
Parameters:
commit: If True it will commit the transaction, False otherwise
min_max_eve: minimum and maximum event to retrieve and erase
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes defined here:
- __pk__ = 'eve_seq'
- __table__ = 'event'
- eve_seq = None
- eve_tas_id = None
| |