MECO™ API Reference
Public Member Functions | List of all members
mFileSystem.simpleWatcherLib.SimpleWatcher Class Reference

[ CLASS ] - Class to watch file changes. More...

Inheritance diagram for mFileSystem.simpleWatcherLib.SimpleWatcher:

Public Member Functions

def __init__ (self, path, recursive=False, extension=None, createdCallback=None, editedCallback=None, deletedCallback=None, callback=None)
 Constructor. More...
 
def start (self)
 Start watcher. More...
 
def stop (self)
 Stop watcher. More...
 

Detailed Description

[ CLASS ] - Class to watch file changes.

import sys
def created(fileList):
sys.stdout.write('created')
sys.stdout.write(fileList)
def edited(fileList):
sys.stdout.write('edited')
sys.stdout.write(fileList)
def deleted(fileList):
sys.stdout.write('deleted')
sys.stdout.write(fileList)
def changed(fileList):
sys.stdout.write('changed')
sys.stdout.write(fileList)
_watcher = mFileSystem.simpleWatcherLib.SimpleWatcher(path='absolutePath',
recursive=False,
extension='py',
createdCallback=created,
editedCallback=edited,
deletedCallback=deleted,
callback=changed)
)
_watcher.start()
#_watcher.stop()

Constructor & Destructor Documentation

◆ __init__()

def mFileSystem.simpleWatcherLib.SimpleWatcher.__init__ (   self,
  path,
  recursive = False,
  extension = None,
  createdCallback = None,
  editedCallback = None,
  deletedCallback = None,
  callback = None 
)

Constructor.

Parameters
path[ str | None | in ] - Absolute directory to be watched.
recursive[ bool | False | in ] - Whether to watch recursively.
extension[ str | None | in ] - Extension of the files to be watched.
createdCallback[ function | None | in ] - Created callback.
editedCallback[ function | None | in ] - Edited callback.
deletedCallback[ function | None | in ] - Deleted callback.
callback[ function | None | in ] - Callback.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ start()

def mFileSystem.simpleWatcherLib.SimpleWatcher.start (   self)

Start watcher.

Exceptions
N/A
Returns
None - None.

◆ stop()

def mFileSystem.simpleWatcherLib.SimpleWatcher.stop (   self)

Stop watcher.

Exceptions
N/A
Returns
None - None.

The documentation for this class was generated from the following file:
mFileSystem.simpleWatcherLib.SimpleWatcher
[ CLASS ] - Class to watch file changes.
Definition: simpleWatcherLib.py:75
mFileSystem.simpleWatcherLib
[ MODULE ] - Watch for file changes.
Definition: simpleWatcherLib.py:1