Changeset 57:a207bc82c12a in livinglogic.python.tipimaid for liaalh_sender.py

Show
Ignore:
Timestamp:
12/23/08 16:37:05 (11 years ago)
Author:
Nikolas Tautenhahn <nik@…>
Branch:
default
Message:

made buffertime and backuppath \"required options\"

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • liaalh_sender.py

    r56 r57  
    2020            self.buffertime = datetime.timedelta(seconds=buffertime - 3) # just to be sure... 
    2121        else: 
    22             self.buffertime = 0 
     22            self.buffertime = datetime.timedelta(seconds=0) 
    2323        self.buffer = [] 
    2424        self.startedbuffering = datetime.datetime.now() 
     
    215215    p.add_option("-p", "--backuppath", dest="backuppath", type="string", action="store", help="Directory where recovery logs should be stored if the network connection dies", default=None) 
    216216    (options, args) = p.parse_args() 
    217     if len(args) != 2 or intify(args[1], None) is None: 
     217    if len(args) != 2 or intify(args[1], None) is None or options.buffertime== 0 or options.backuppath is None: 
    218218        p.print_usage(sys.stderr) 
    219         sys.stderr.write("%s: We need an IP and a port\n" % p.get_prog_name()) 
     219        sys.stderr.write("%s: Please specify ip, port, a buffertime and a path for local backups!\n" % p.get_prog_name()) # required options... not so nice but necessary 
    220220        sys.stderr.flush() 
    221221        return 1