当前位置: 首页>>代码示例>>Python>>正文


Python Sync.start_sync方法代码示例

本文整理汇总了Python中sync.Sync.start_sync方法的典型用法代码示例。如果您正苦于以下问题:Python Sync.start_sync方法的具体用法?Python Sync.start_sync怎么用?Python Sync.start_sync使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sync.Sync的用法示例。


在下文中一共展示了Sync.start_sync方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: main

# 需要导入模块: from sync import Sync [as 别名]
# 或者: from sync.Sync import start_sync [as 别名]
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()
开发者ID:akaDashe,项目名称:flickrsmartsync,代码行数:36,代码来源:__init__.py

示例2: main

# 需要导入模块: from sync import Sync [as 别名]
# 或者: from sync.Sync import start_sync [as 别名]
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()
开发者ID:pthiben,项目名称:flickrsmartsync,代码行数:58,代码来源:__init__.py

示例3: main

# 需要导入模块: from sync import Sync [as 别名]
# 或者: from sync.Sync import start_sync [as 别名]
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()
开发者ID:baboulaz,项目名称:flickrsmartsync,代码行数:55,代码来源:__init__.py


注:本文中的sync.Sync.start_sync方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。