Ejemplo n.º 1
0
def run():
    if not tools.mount_camera():
        print 'Could not connect to camera. Try again.'
    tools.get_camera_files()
    if tools.umount_camera():
        print 'You can disconnect the camera now.'
    else:
        print 'Could not disconnect from camera. Please use the software ' \
              'safely remove function before disconnecting.'
    names = os.listdir('infiles/')
    names.sort()
    for infile in names:
        #group_name = raw_input('Group name: ')
        timeid = time.strftime('%a/%H%M%S', time.localtime())
        process(infile, timeid)
        os.rename('infiles/' + infile, 'outfiles/{}.jpg'.format(timeid))
    print "Finished."
Ejemplo n.º 2
0
 def on_get_photos(self, _event):
     if not tools.mount_camera():
         self.SetStatusText('Could not connect to camera. Try again.')
     tools.get_camera_files()
     if tools.umount_camera():
         self.SetStatusText('You can disconnect the camera now.')
     else:
         self.SetStatusText('Could not disconnect from camera.')
     names = os.listdir('infiles')
     names.sort()
     day = tools.get_day()
     tools.mkdir_p(os.path.join('outfiles', day))
     self.names = names
     if len(self.names) > 0:
         self.load_image(0)
     else:
         self.next_btn.Disable()
         self.prev_btn.Disable()
         self.load_blank()
Ejemplo n.º 3
0
def run():
    if not tools.mount_camera():
        print 'Could not connect to camera. Try again.'
    tools.get_camera_files()
    if tools.umount_camera():
        print 'You can disconnect the camera now.'
    else:
        print 'Could not disconnect from camera. Please use the software ' \
              'safely remove function before disconnecting.'
    names = os.listdir('infiles')
    names.sort()
    for infile in names:
        day = tools.get_day()
        #group_name = raw_input('Group name: ')
        timeid = time.strftime('%H%M%S', time.localtime())
        process(infile, day, timeid)
        outfile_name = '{}.jpg'.format(timeid)
        os.rename(os.path.join('infiles', infile),
                  os.path.join('outfiles', day, outfile_name))
    print "Finished."
Ejemplo n.º 4
0
 def on_get_photos(self, event_):
     if not tools.mount_camera():
         self.SetStatusText('Could not connect to camera. Try again.')
     tools.get_camera_files()
     if tools.umount_camera():
         self.SetStatusText('You can disconnect the camera now.')
     else:
         self.SetStatusText('Could not disconnect from camera.')
     names = os.listdir('infiles/')
     names.sort()
     day = tools.get_day()
     if not os.path.exists('outfiles/{}'.format(day)):
         os.mkdir('outfiles/{}'.format(day))
     self.names = names
     if len(self.names) > 0:
         self.load_image(0)
     else:
         self.next_btn.Disable()
         self.prev_btn.Disable()
         self.load_blank()
Ejemplo n.º 5
0
def run():
    if not tools.mount_camera():
        print 'Could not connect to camera. Try again.'
    tools.get_camera_files()
    if tools.umount_camera():
        print 'You can disconnect the camera now.'
    else:
        print 'Could not disconnect from camera.'
    names = os.listdir('infiles')
    names.sort()
    day = tools.get_day()
    if not os.path.exists(os.path.join('outfiles', day)):
        os.mkdir(os.path.join('outfiles', day))
    for infile in names:
        group_name = raw_input('Group name: ')
        timeid = time.strftime('%H%M%S', time.localtime())
        process(os.path.join('infiles', infile), group_name, day, timeid)
        outfile_name = '{}_{}.jpg'.format(timeid, tools.safe_filename(group_name))
        os.rename(os.path.join('infiles', infile),
                  os.path.join('outfiles', day, outfile_name))
    print 'Finished.'
Ejemplo n.º 6
0
def run():
    if not tools.mount_camera():
        print 'Could not connect to camera. Try again.'
    tools.get_camera_files()
    if tools.umount_camera():
        print 'You can disconnect the camera now.'
    else:
        print 'Could not disconnect from camera.'
    names = os.listdir('infiles')
    names.sort()
    day = tools.get_day()
    tools.mkdir_p(os.path.join('outfiles', day))
    for infile in names:
        group_name = raw_input('Group name: ')
        timeid = time.strftime('%H%M%S', time.localtime())
        process(os.path.join('infiles', infile), group_name, day, timeid)
        outfile_name = '{}_{}.jpg'.format(timeid,
                                          tools.safe_filename(group_name))
        os.rename(os.path.join('infiles', infile),
                  os.path.join('outfiles', day, outfile_name))
    print 'Finished.'