Changeset 57:a207bc82c12a in livinglogic.python.tipimaid
- Timestamp:
- 12/23/08 16:37:05 (10 years ago)
- Author:
- Nikolas Tautenhahn <nik@…>
- Branch:
- default
- Message:
-
made buffertime and backuppath \"required options\"
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
r56
|
r57
|
|
20 | 20 | self.buffertime = datetime.timedelta(seconds=buffertime - 3) # just to be sure... |
21 | 21 | else: |
22 | | self.buffertime = 0 |
| 22 | self.buffertime = datetime.timedelta(seconds=0) |
23 | 23 | self.buffer = [] |
24 | 24 | self.startedbuffering = datetime.datetime.now() |
… |
… |
|
215 | 215 | 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) |
216 | 216 | (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: |
218 | 218 | 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 |
220 | 220 | sys.stderr.flush() |
221 | 221 | return 1 |