Beispiel #1
0
 argparser.add_argument( '--temp_dir', help = 'override the program\'s temporary directory' )
 argparser.add_argument( '--no_daemons', action='store_true', help = 'run without background daemons' )
 argparser.add_argument( '--no_wal', action='store_true', help = 'run without WAL db journaling' )
 argparser.add_argument( '--db_memory_journaling', action='store_true', help = 'run db journaling entirely in memory (DANGEROUS)' )
 argparser.add_argument( '--db_synchronous_override', help = 'override SQLite Synchronous PRAGMA (range 0-3, default=2)' )
 argparser.add_argument( '--no_db_temp_files', action='store_true', help = 'run db temp operations entirely in memory' )
 
 result = argparser.parse_args()
 
 action = result.action
 
 if result.db_dir is None:
     
     db_dir = HC.DEFAULT_DB_DIR
     
     if not HydrusPaths.DirectoryIsWritable( db_dir ) or HC.RUNNING_FROM_MACOS_APP:
         
         db_dir = HC.USERPATH_DB_DIR
         
     
 else:
     
     db_dir = result.db_dir
     
 
 db_dir = HydrusPaths.ConvertPortablePathToAbsPath( db_dir, HC.BASE_DIR )
 
 try:
     
     HydrusPaths.MakeSureDirectoryExists( db_dir )
     
Beispiel #2
0
 argparser = argparse.ArgumentParser( description = 'hydrus network server' )
 
 argparser.add_argument( 'action', default = 'start', nargs = '?', choices = [ 'start', 'stop', 'restart' ], help = 'either start this server (default), or stop an existing server, or both' )
 argparser.add_argument( '-d', '--db_dir', help = 'set an external db location' )
 argparser.add_argument( '--no_daemons', action='store_true', help = 'run without background daemons' )
 argparser.add_argument( '--no_wal', action='store_true', help = 'run without WAL db journalling' )
 
 result = argparser.parse_args()
 
 action = result.action
 
 if result.db_dir is None:
     
     db_dir = HC.DEFAULT_DB_DIR
     
     if not HydrusPaths.DirectoryIsWritable( db_dir ):
         
         db_dir = os.path.join( os.path.expanduser( '~' ), 'Hydrus' )
         
     
 else:
     
     db_dir = result.db_dir
     
 
 db_dir = HydrusPaths.ConvertPortablePathToAbsPath( db_dir, HC.BASE_DIR )
 
 
 try:
     
     HydrusPaths.MakeSureDirectoryExists( db_dir )