コード例 #1
0
ファイル: server.py プロジェクト: jeekl/hydrus
    from include import HydrusExceptions
    from include import HydrusConstants as HC
    from include import HydrusData

    import os
    import sys
    import time

    from include import ServerController
    import threading
    from twisted.internet import reactor
    from include import HydrusGlobals
    from include import HydrusLogger
    import traceback

    action = ServerController.GetStartingAction()

    if action == 'help':

        HydrusData.Print(
            'This is the hydrus server. It accepts these commands:')
        HydrusData.Print('')
        HydrusData.Print('server start - runs the server')
        HydrusData.Print(
            'server stop - stops an existing instance of this server')
        HydrusData.Print(
            'server restart - stops an existing instance of this server, then runs itself'
        )
        HydrusData.Print('')
        HydrusData.Print(
            'You can also run \'server\' without arguments. Depending on what is going on, it will try to start or it will ask you if you want to stop or restart.'
コード例 #2
0
            raise Exception( 'db_synchronous_override must be in the range 0-3' )
            
        
    
    HG.no_db_temp_files = result.no_db_temp_files
    
    if result.temp_dir is not None:
        
        HydrusPaths.SetEnvTempDir( result.temp_dir )
        
    
    #
    
    try:
        
        action = ServerController.ProcessStartingAction( db_dir, action )
        
    except HydrusExceptions.ShutdownException as e:
        
        HydrusData.Print( e )
        
        action = 'exit'
        
    
    if action == 'exit':
        
        sys.exit( 0 )
        
    
except Exception as e: