def create_snapshot(): os.system('clear') print(""" CREATE SNAPSHOT =============================== """) snap_dir = input("Podaj nazwę katalogu, którego snapa chcesz zrobić: ") snap_file = input("Podaj nazwę katalogu wyjściowego: ") snapshothelper.createSnapshot(snap_dir, snap_file)
choice = raw_input("\t") return choice #MENU DECISION STRUCTURE choice = "" while choice != "5": choice = menu() if choice == "1": os.system('cls') print '''CREATE SNAPSHOT ====================================''' directory = raw_input \ ("Enter the directory name to create a snapshot of: ") filename = raw_input \ ("Enter the name of the snapshot file to create: ") snapshothelper.createSnapshot(directory, filename) elif choice == "2": os.system('cls') print ''' LIST SNAPSHOT FILES ==================================== Enter the file extension for your snapshot files (for example, 'snp' if your files end in '.snp'): ''' extension = raw_input("\t\t") snapshothelper.listSnapshots(extension) elif choice == "3": os.system('cls') print ''' COMPARE SNAPSHOTS ====================================
return choice #MENU DECISION STRUCTURE choice = " " while choice != "5": choice = menu() if choice == "1": os.system('clear') print '''CREATE SNAPSHOT =============================''' directory = raw_input \ ("Enter the directory name to create a snapshot of: ") filename = raw_input \ ("Enter the name of the snapshot file to create: ") snapshothelper.createSnapshot(directory, filename) elif choice == "2": os.system('clear') print ''' LIST SNAPSHOT FILES ============================= Enter the file extension for your snapshot files (for example, 'snp' if your files end in '.snp'): ''' extension = raw_input("\t\t") snapshothelper.listSnapshots(extension) elif choice == "3": os.system('clear') print ''' COMPARE SNAPSHOTS ==============================
def testprogramfilesdir(self): # make a snapshot of the Python25 directory snapshothelper.createSnapshot('c:\\program files', 'programfilessnap.snp') assert 'programfilessnap.snp' in os.listdir( os.curdir), 'Snapshot not created!'
def testpython25snap(self): # make a snapshot of the Python25 directory snapshothelper.createSnapshot('c:\\python25', 'python25snap.snp') assert 'python25snap.snp' in os.listdir( os.curdir), 'Snapshot not created!'
def testprogramfilesdir(self): # make a snapshot of the Python25 directory snapshothelper.createSnapshot('c:\\program files', 'programfilessnap.snp') assert 'programfilessnap.snp' in os.listdir(os.curdir), 'Snapshot not created!'
def testpython25snap(self): # make a snapshot of the Python25 directory snapshothelper.createSnapshot('c:\\python25', 'python25snap.snp') assert 'python25snap.snp' in os.listdir(os.curdir), 'Snapshot not created!'
#MENU DEscision Structure choice="" while choice !="5": choice=menu() if choice == "1": os.system('clear') print ''' ======================== CREATE SNAPSHOT ======================== ''' directoryName=raw_input('Enter directory name to create snapshot of: ') fileName=raw_input('Save snapshot as file: ') snapshothelper.createSnapshot(directoryName,fileName) elif choice=="2": os.system('clear') print ''' ======================== LIST OF SNAPSHOT FILES ======================== ''' extension=raw_input('Extension of snapshot files: ') snapshothelper.listAllSnapshotFiles(extension) elif choice=="4": os.system('clear') print ''' ======================== VIEW SNAPSHOT ========================