<s> import sys <EOL> from os import path <EOL> sys . path . insert ( <NUM_LIT:0> , path . join ( path . dirname ( __file__ ) , '<STR_LIT:src>' ) ) <EOL> from datetime import timedelta <EOL> from tarsnapper . test import BackupSimulator <EOL> from tarsnapper . config import parse_deltas <EOL> def main ( argv ) : <EOL> if '<STR_LIT>' in argv : <EOL> print "<STR_LIT>" <EOL> return <NUM_LIT:1> <EOL> if not argv : <EOL> s = BackupSimulator ( parse_deltas ( '<STR_LIT>' ) ) <EOL> until = s . now + timedelta ( days = <NUM_LIT> ) <EOL> while s . now <= until : <EOL> s . go_by ( timedelta ( days = <NUM_LIT:1> ) ) <EOL> s . backup ( ) <EOL> for name , date in s . backups . iteritems ( ) : <EOL> print name <EOL> else : <EOL> s = BackupSimulator ( parse_deltas ( '<STR_LIT>' ) ) <EOL> s . add ( [ d for d in argv ] ) <EOL> deleted , _ = s . expire ( ) <EOL> print "<STR_LIT>" <EOL> for name in deleted : <EOL> print ( name ) <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> for name , date in s . backups . iteritems ( ) : <EOL> print name <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> sys . exit ( main ( sys . argv [ <NUM_LIT:1> : ] ) or <NUM_LIT:0> ) </s>
