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
 
@@ -59,12 +59,13 @@ class FileMonitorCommand(commands.FileMonitorCommand):
 
    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):
rattail/filemon.py
Show inline comments
 
@@ -26,16 +26,10 @@
 
``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"
 
@@ -43,18 +37,6 @@ class FileMonitorService(win32_server.FileMonitorService):
 
    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)