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
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)
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)