Changeset - 664fd8633268
[Not reviewed]
0 2 0
Lance Edgar (lance) - 12 years ago 2012-08-17 10:53:20
lance@edbob.org
update filemon per edbob changes
2 files changed with 9 insertions and 26 deletions:
0 comments (0 inline, 0 general)
rattail/commands.py
Show inline comments
 
@@ -56,18 +56,19 @@ class FileMonitorCommand(commands.FileMonitorCommand):
 
    """
 
    Interacts with the file monitor service; called as ``rattail filemon``.
 

	
 
    See :class:`edbob.commands.FileMonitorCommand` for more information.
 
    """
 

	
 
    name = 'filemon'
 
    description = "Manage the file monitor service"
 

	
 
    def run(self, args):
 
    def get_win32_module(self):
 
        from rattail import filemon
 
        self.manage_service(args, filemon)
 
        return filemon
 

	
 
    def get_win32_service(self):
 
        from rattail.filemon import RattailFileMonitor
 
        return RattailFileMonitor
 

	
 

	
 
class InitCommand(commands.Subcommand):
 
    """
 
    Initializes the database; called as ``{{package}} initialize``.  This is
 
    meant to be leveraged as part of setting up the application.  The database
rattail/filemon.py
Show inline comments
 
@@ -23,38 +23,20 @@
 
################################################################################
 

	
 
"""
 
``rattail.filemon`` -- Windows File Monitor
 
"""
 

	
 
import sys
 
import subprocess
 
from edbob.filemon.win32 import FileMonitorService
 

	
 
from edbob.filemon import win32_server
 

	
 

	
 
class FileMonitorService(win32_server.FileMonitorService):
 
    """
 
    Implements the Rattail file monitor Windows service.
 
    """
 
class RattailFileMonitor(FileMonitorService):
 

	
 
    _svc_name_ = "Rattail File Monitor"
 
    _svc_display_name_ = "Rattail : File Monitoring Service"
 

	
 
    appname = 'rattail'
 

	
 

	
 
def exec_server_command(command):
 
    """
 
    Executes ``command`` against the file monitor Windows service, i.e. one of:
 

	
 
    * ``'install'``
 
    * ``'start'``
 
    * ``'stop'``
 
    * ``'remove'``
 
    """
 
    subprocess.call([sys.executable, __file__, command])
 

	
 

	
 
if __name__ == '__main__':
 
    import win32serviceutil
 
    win32serviceutil.HandleCommandLine(FileMonitorService)
 
    win32serviceutil.HandleCommandLine(RattailFileMonitor)
0 comments (0 inline, 0 general)