Example #1
0
File: models.py Project: fdb/docbox
 def add(self, page_name):
     if self.doc_vcs == 'svn':
         svnutil.addFile(self.page_path(page_name))
     elif self.doc_vcs == 'git': 
         pass # todo: implement
     else:
         pass # todo: implement
Example #2
0
File: views.py Project: fdb/docbox
def _upload_mob(mob_path, clean_fname, raw_contents):
    dest_fname = os.path.join(mob_path, clean_fname)

    file = open(dest_fname, 'wb')
    file.write(raw_contents)
    file.close()

    svn.addFile(dest_fname)
Example #3
0
File: views.py Project: fdb/docbox
def _upload_image(mob_path, clean_fname, raw_contents):
    dest_fname = os.path.join(mob_path, clean_fname)
    thumb_fname = os.path.join(mob_path, "thumb-" + clean_fname)

    sio = StringIO(raw_contents)

    img = Image.open(sio)
    image_util.universal_resize(img, 550, 550).save(dest_fname)
    image_util.universal_resize(img, 100, 100).save(thumb_fname)

    svn.addFile(dest_fname)
    svn.addFile(thumb_fname)