def __init__(self, folder, dropboxClient=None):
        if dropboxClient:
            dropbox_file_list = dbo.list_folder(dropboxClient, 'Camera Uploads')
            self.dropboxClient = dropboxClient
        else:
            dropbox_file_list = []

        fileList = self._getFileList(folder)
        self.imageList = ImageList(fileList, dropbox_file_list)
    def onClick(self, event):
        date = ''
        #try:
        img = pygame.image.frombuffer(self.mainWindow.display.picture, self.mainWindow.display.size, 'RGB')
        date = datetime.datetime.now().strftime("%Y%m%d%H%M%S")
        pygame.image.save(os.path.join(self.save_path, img), '%s.jpeg' % date)
        time.sleep(1)

        #except:
            #print 'failed to capture image at %s' % datetime.datetime.now().strftime("%Y%m%d%H%M%S")

        if date:
            #exif stuff
            filename = date + '.jpeg'

            with open(filename, 'rb'):
                jpeg = pexif.JpegFile.fromFile(filename)
                exif = jpeg.get_exif(create=True)
                exif.primary.ExtendedEXIF.DateTimeOriginal = date
                #print os.getcwd() + '\\' + filename
            dbo.upload_file(self.client,filename,'Camera Uploads')
 def onLogin(self, event):
     key,secret = dbo.config()
     self.client = dbo.connect(key,secret)
__author__ = 'sec'

import Comparison.DropboxApiStub as dbapi
from Comparison.ImageData import ImageList, ImageData
from Dropbox.DropBoxObject import DropBoxObject
import Dropbox.DropBoxFuncts as dbo
import os

#dropbox_file_list = dbapi.getDropboxFilenames()
key,secret = dbo.config()
client = dbo.connect(key,secret)
dropbox_file_list = dbo.list_folder(client, 'Camera Uploads')
print dropbox_file_list
local_file_list = dbapi.getLocalFilenames()
print local_file_list
img_list = ImageList(local_file_list, dropbox_file_list)

print 'len of img_list', len(img_list)

for img in img_list:
    print img.filename
    print img.DropboxFilename()
    print img.IsInDropbox()

print img_list.ExistingMonths()