def main(): parser = argparse.ArgumentParser(description='Sync current folder to your flickr account.') parser.add_argument('--monitor', action='store_true', help='starts a daemon after sync for monitoring') parser.add_argument('--starts-with', type=str, help='only sync that path that starts with') parser.add_argument('--download', type=str, help='download the photos from flickr specify a path or . for all') parser.add_argument('--ignore-videos', action='store_true', help='ignore video files') parser.add_argument('--ignore-images', action='store_true', help='ignore image files') parser.add_argument('--version', action='store_true', help='output current version') parser.add_argument('--sync-path', type=str, default=os.getcwd(), help='specify the sync folder (default is current dir)') parser.add_argument('--custom-set', type=str, help='customize your set name from path with regex') parser.add_argument('--custom-set-builder', type=str, help='build your custom set title (default just merge groups)') parser.add_argument('--update-custom-set', action='store_true', help='updates your set title from custom set') parser.add_argument('--username', type=str, help='token username') #token username argument for api parser.add_argument('--keyword', action='append', type=str, help='only upload files matching this keyword') args = parser.parse_args() if args.version: # todo get from setup.cfg logger.info('v0.1.17') exit() # validate args args.is_windows = os.name == 'nt' args.sync_path = args.sync_path.rstrip(os.sep) + os.sep if not os.path.exists(args.sync_path): logger.error('Sync path does not exists') exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()
def main(): parser = argparse.ArgumentParser(description='Sync current folder to your flickr account.') parser.add_argument('--monitor', action='store_true', help='starts a daemon after sync for monitoring') parser.add_argument('--dry-run', action='store_true', help='do not perform any remote action') parser.add_argument('--starts-with', type=str, help='only sync that path starts with this text, e.g. "2015/06"') parser.add_argument('--download', type=str, help='download the photos from flickr, specify a path or . for all') parser.add_argument('--ignore-videos', action='store_true', help='ignore video files') parser.add_argument('--ignore-images', action='store_true', help='ignore image files') parser.add_argument('--ignore-ext', type=str, help='comma separated list of extensions to ignore, e.g. "jpg,png"') parser.add_argument('--version', action='store_true', help='output current version: ' + version) parser.add_argument('--sync-path', type=str, default=os.getcwd(), help='specify the sync folder (default is current dir)') parser.add_argument('--sync-from', type=str, help='Only supported value: "all". Uploads anything that isn\'t on flickr, and download anything that isn\'t on the local filesystem') parser.add_argument('--custom-set', type=str, help='customize your set name from path with regex, e.g. "(.*)/(.*)"') parser.add_argument('--custom-set-builder', type=str, help='build your custom set title, e.g. "{0} {1}" to join the first two groups (default merges groups with hyphen)') parser.add_argument('--update-custom-set', action='store_true', help='updates your set title from custom-set (and custom-set-builder, if given)') parser.add_argument('--custom-set-debug', action='store_true', help='for testing your custom sets, asks for confirmation when creating an album on flickr') parser.add_argument('--username', type=str, help='token username') # token username argument for api parser.add_argument('--add-photo-prefix', type=str, help='Add a specific prefix to the remote files whose local files have that prefix') parser.add_argument('--iphoto', action='store_true', help='Backup iPhoto Masters folder') parser.add_argument('--keyword', action='append', type=str, help='only upload files matching this keyword') args = parser.parse_args() if args.version: logger.info(version) exit() # validate args args.is_windows = os.name == 'nt' args.sync_path = args.sync_path.rstrip(os.sep) + os.sep if not os.path.exists(args.sync_path): logger.error('Sync path does not exists') exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()
def main(): parser = argparse.ArgumentParser(description="Sync current folder to your flickr account.") parser.add_argument("--monitor", action="store_true", help="starts a daemon after sync for monitoring") parser.add_argument("--starts-with", type=str, help='only sync that path starts with this text, e.g. "2015/06"') parser.add_argument("--download", type=str, help="download the photos from flickr, specify a path or . for all") parser.add_argument("--ignore-videos", action="store_true", help="ignore video files") parser.add_argument("--ignore-images", action="store_true", help="ignore image files") parser.add_argument("--ignore-ext", type=str, help='comma separated list of extensions to ignore, e.g. "jpg,png"') parser.add_argument("--version", action="store_true", help="output current version: " + version) parser.add_argument( "--sync-path", type=str, default=os.getcwd(), help="specify the sync folder (default is current dir)" ) parser.add_argument( "--sync-from", type=str, help="Only supported value: \"all\". Uploads anything that isn't on flickr, and download anything that isn't on the local filesystem", ) parser.add_argument("--custom-set", type=str, help='customize your set name from path with regex, e.g. "(.*)/(.*)"') parser.add_argument( "--custom-set-builder", type=str, help='build your custom set title, e.g. "{0} {1}" to join the first two groups (default merges groups with hyphen)', ) parser.add_argument( "--update-custom-set", action="store_true", help="updates your set title from custom-set (and custom-set-builder, if given)", ) parser.add_argument( "--custom-set-debug", action="store_true", help="for testing your custom sets, asks for confirmation when creating an album on flickr", ) parser.add_argument("--username", type=str, help="token username") # token username argument for api parser.add_argument("--keyword", action="append", type=str, help="only upload files matching this keyword") args = parser.parse_args() if args.version: logger.info(version) exit() # validate args args.is_windows = os.name == "nt" args.sync_path = args.sync_path.rstrip(os.sep) + os.sep if not os.path.exists(args.sync_path): logger.error("Sync path does not exists") exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()
def main(): parser = argparse.ArgumentParser( description='Sync current folder to your flickr account.') parser.add_argument('--monitor', action='store_true', help='Start monitoring daemon.') parser.add_argument( '--starts-with', type=str, help='Only sync those paths that start with this text, e.g. "2015/06."' ) parser.add_argument( '--download', type=str, help='Download photos from flickr. Specify a path or use "." for all.') parser.add_argument('--dry-run', action='store_true', help='Do not download or upload anything.') parser.add_argument('--ignore-videos', action='store_true', help='Ignore video files.') parser.add_argument('--ignore-images', action='store_true', help='Ignore image files.') parser.add_argument( '--ignore-ext', type=str, help= 'Comma separated list of filename extensions to ignore, e.g. "jpg,png".' ) parser.add_argument('--fix-missing-description', action='store_true', help='Replace missing set description with set title.') parser.add_argument('--version', action='store_true', help='Output current version: ' + version) parser.add_argument('--sync-path', type=str, default=os.getcwd(), help='Specify sync path (default: current dir).') parser.add_argument( '--sync-from', type=str, help= 'Only one supported value: "all". Upload anything not on flickr. Download anything not on the local filesystem.' ) parser.add_argument( '--custom-set', type=str, help='Customize set name from path with regex, e.g. "(.*)/(.*)".') parser.add_argument( '--custom-set-builder', type=str, help= 'Build custom set title, e.g. "{0} {1}" joins first two groups (default behavior merges groups using a hyphen).' ) parser.add_argument( '--update-custom-set', action='store_true', help= 'Updates set title from custom-set (and custom-set-builder, if given).' ) parser.add_argument( '--custom-set-debug', action='store_true', help= 'When testing custom sets: ask for confirmation before creating an album.' ) parser.add_argument('--username', type=str, help='Token username argument for API.') parser.add_argument('--keyword', action='append', type=str, help='Only upload files matching this keyword.') args = parser.parse_args() if args.version: logger.info(version) exit() # Windows OS args.is_windows = os.name == 'nt' args.sync_path = args.sync_path.rstrip(os.sep) + os.sep if not os.path.exists(args.sync_path): logger.error('Sync path does not exist.') exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()
def main(): parser = argparse.ArgumentParser( description='Sync current folder to your flickr account.') parser.add_argument('--monitor', action='store_true', help='starts a daemon after sync for monitoring') parser.add_argument( '--starts-with', type=str, help='only sync that path starts with this text, e.g. "2015/06"') parser.add_argument( '--download', type=str, help='download the photos from flickr, specify a path or . for all') parser.add_argument('--ignore-videos', action='store_true', help='ignore video files') parser.add_argument('--ignore-images', action='store_true', help='ignore image files') parser.add_argument( '--ignore-ext', type=str, help='comma separated list of extensions to ignore, e.g. "jpg,png"') parser.add_argument('--version', action='store_true', help='output current version: ' + version) parser.add_argument( '--sync-path', type=str, default=os.getcwd(), help='specify the sync folder (default is current dir)') parser.add_argument( '--sync-from', type=str, help= 'Only supported value: "all". Uploads anything that isn\'t on flickr, and download anything that isn\'t on the local filesystem' ) parser.add_argument( '--custom-set', type=str, help='customize your set name from path with regex, e.g. "(.*)/(.*)"') parser.add_argument( '--custom-set-builder', type=str, help= 'build your custom set title, e.g. "{0} {1}" to join the first two groups (default merges groups with hyphen)' ) parser.add_argument( '--update-custom-set', action='store_true', help= 'updates your set title from custom-set (and custom-set-builder, if given)' ) parser.add_argument( '--custom-set-debug', action='store_true', help= 'for testing your custom sets, asks for confirmation when creating an album on flickr' ) parser.add_argument( '--username', type=str, help='token username') # token username argument for api parser.add_argument('--keyword', action='append', type=str, help='only upload files matching this keyword') args = parser.parse_args() if args.version: logger.info(version) exit() # validate args args.is_windows = os.name == 'nt' args.sync_path = args.sync_path.rstrip(os.sep) + os.sep if not os.path.exists(args.sync_path): logger.error('Sync path does not exists') exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()
def main(): parser = argparse.ArgumentParser( description='Upload, download or sync photos and videos to Flickr.') parser.add_argument( '--custom-set', type=str, help= 'customize set title from path using standard regex, e.g. "(.*)/(.*)"') parser.add_argument( '--custom-set-builder', type=str, help= 'build a custom set title using matched groups, e.g. "{0}{1}" joins first two "(.*)/(.*)"' ) parser.add_argument( '--download', type=str, help='download photos; specify a path or use "." for all') parser.add_argument( '--dry-run', action='store_true', help='report actions but do not change local/remote sets') parser.add_argument('--fix-missing-description', action='store_true', help='replace missing set description with set title') parser.add_argument( '--ignore-extensions', type=str, help='comma separated list of filename extensions to ignore') parser.add_argument( '--ignore-images', action='store_true', help='ignore image files: jpg, jpeg, png, gif, tif, tiff, bmp') parser.add_argument( '--ignore-videos', action='store_true', help= 'ignore video files: m4v, mp4, avi, wmv, mov, mpg, mpeg, 3gp, mts, m2ts, ogg, ogv' ) parser.add_argument( '--keywords', action='append', type=str, help='only upload files with IPTC metadata matching these keywords') parser.add_argument( '--nobrowser', action='store_true', help='support manual authentication when no web browser is available') parser.add_argument('--starts-with', type=str, help='only upload paths starting with this text') parser.add_argument( '--sync', action='store_true', help= 'upload anything not on Flickr; download anything not on local filesystem' ) parser.add_argument( '--sync-path', type=str, default=os.getcwd(), help= 'sync path (default: current dir); individual files in --sync-path root are not synced to avoid disorganized Flickr sets' ) parser.add_argument('--version', action='store_true', help='print current version: ' + version) args = parser.parse_args() args.windows = os.name == "nt" if args.version: logger.info('--version %s', version) exit(0) else: logger.debug('--version %s', version) args.sync_path = args.sync_path.rstrip( os.sep) + os.sep # ensure sync path ends with "/" if not os.path.exists(args.sync_path): logger.error('--sync-path "%s" does not exist', args.sync_path) exit(0) local = Local(args) remote = Remote(args) sync = Sync(args, local, remote) sync.start_sync()