Example #1
0
 def organize(self):
     try:
         dst = self.args[0].lower()
     except IndexError:
         raise OrganizerExceptions.CommandLineArgumentException(
             'Must Enter a destination argument.')
     if dst == 'local':
         path = '/Users/agreen/.stage/finished/'
     elif dst == 'papa':
         path = '/Volumes/Papa/.finished/'
     elif dst == 'test':
         path = '/Users/agreen/Desktop/test/'
     else:
         raise OrganizerExceptions.CommandLineArgumentException(
             'Must Enter a location argument')
     files_to_top = True
     target_path = os.path.join(path, '../.organized')
     if not os.path.exists(target_path):
         os.mkdir(target_path)
     excluded_names = ['random', 'series', 'finished']
     names = Names(names_to_exclude=excluded_names)
     names.get_names_from_files_and_dirs([target_path])
     organizer = Organizer(names,
                           path,
                           target_path,
                           files_to_exclude=['.organized'])
     organizer.moveFilesForFirstAndLastName()
     if files_to_top:
         mover = FilesToTop(target_path, excluded_names)
         mover.moveFilesToTop()
     return None
Example #2
0
 def organize(self):
     try:
         dst = self.args[0].lower()
     except IndexError:
         raise OrganizerExceptions.CommandLineArgumentException('Must Enter a destination argument.')
     if dst == 'local':
         path = '/Users/agreen/.stage/finished/'
     elif dst == 'papa':
         path = '/Volumes/Papa/.finished/'
     elif dst == 'test':
         path = '/Users/agreen/Desktop/test/'
     else:
         raise OrganizerExceptions.CommandLineArgumentException('Must Enter a location argument')
     files_to_top = True
     target_path = os.path.join(path, '../.organized')
     if not os.path.exists(target_path):
         os.mkdir(target_path)
     excluded_names = ['random', 'series', 'finished']
     names = Names(names_to_exclude=excluded_names)
     names.get_names_from_files_and_dirs([target_path])
     organizer = Organizer(names, path, target_path, files_to_exclude=['.organized'])
     organizer.moveFilesForFirstAndLastName()
     if files_to_top:
         mover = FilesToTop(target_path, excluded_names)
         mover.moveFilesToTop()
     return None
Example #3
0
 def remove_files(self):
     moveToTop = True
     path = '/Volumes/Papa/.finished/'
     excludedNames = ['random', 'series', 'finished']
     remover = FileRemover(path, ['sample'])
     remover.removeFiles(remover.path)
     if moveToTop:
         mover = FilesToTop(path, excludedNames)
         mover.moveFilesToTop()
     return None
Example #4
0
 def remove_files(self):
     moveToTop = True
     path = '/Volumes/Charlie/.p/'
     excludedNames = ['random', 'series', 'finished']
     remover = FileRemover(path, ['sample'])
     remover.removeFiles(remover.path)
     if moveToTop:
         mover = FilesToTop(path, excludedNames)
         mover.moveFilesToTop()
     return None