示例#1
0
 def execute(self, args):
     print('Running translate task...')
     categories = filesystem.loader(args['root_folder']).load()
     filesystem_client = filesystem.client(args['root_folder'])
     zendesk.pusher(args['company_uri'], args['user'], args['password'],
                    filesystem_client, args['image_cdn'], args['disable_article_comments']).push(categories)
     print('Done')
示例#2
0
 def execute(self, args):
     print('Running translate task...')
     categories = filesystem.loader(args['root_folder']).load()
     categories = translate.translator(
         args['webtranslateit_api_key']).create(categories)
     filesystem.saver(args['root_folder']).save(categories)
     print('Done')
示例#3
0
 def execute(self, args):
     print('Running translate task...')
     categories = filesystem.loader(args['root_folder']).load()
     filesystem_client = filesystem.client(args['root_folder'])
     zendesk.pusher(args['company_uri'], args['user'], args['password'],
                    filesystem_client, args['image_cdn'],
                    args['disable_article_comments']).push(categories)
     print('Done')
示例#4
0
 def execute(self, args):
     logging.info('Running export task...')
     categories = filesystem.loader(
         args['root_folder'], args['disable_article_comments']).load()
     filesystem_client = filesystem.client(args['root_folder'])
     zendesk.pusher(args['company_uri'], args['user'], args['password'],
                    filesystem_client).push(categories)
     logging.info('Export task completed')
示例#5
0
    def execute(self, args):
        print('Running remove task...')
        path = os.path.join(args['root_folder'], args['path'])

        if not os.path.exists(path):
            logging.error('Provided path %s does not exist', path)
            return

        item = filesystem.loader(args['root_folder']).load_from_path(path)
        zendesk.remover(args['company_uri'], args['user'], args['password']).remove(item)
        translate.remover(args['webtranslateit_api_key']).remove(item)
        filesystem.remover(args['root_folder']).remove(item)
        print('Done')
示例#6
0
    def execute(self, args):
        print('Running remove task...')
        path = os.path.join(args['root_folder'], args['path'])

        if not os.path.exists(path):
            logging.error('Provided path %s does not exist', path)
            return

        item = filesystem.loader(args['root_folder']).load_from_path(path)
        zendesk.remover(args['company_uri'], args['user'],
                        args['password']).remove(item)
        translate.remover(args['webtranslateit_api_key']).remove(item)
        filesystem.remover(args['root_folder']).remove(item)
        print('Done')
示例#7
0
    def execute(self, args):
        print('Running doctor task...')
        categories = filesystem.loader(args['root_folder']).load()
        filesystem_client = filesystem.client(args['root_folder'])
        filesystem_doctor = filesystem.doctor(args['root_folder'])
        translate_doctor = translate.doctor(args['webtranslateit_api_key'])
        zendesk_doctor = zendesk.doctor(
            args['company_uri'], args['user'], args['password'], filesystem_client, args['force'])

        zendesk_doctor.fix(categories)
        filesystem_doctor.fix(categories)
        translate_doctor.fix(categories)

        filesystem.saver(args['root_folder']).save(categories)

        print('Done')
示例#8
0
    def execute(self, args):
        print('Running doctor task...')
        categories = filesystem.loader(args['root_folder']).load()
        filesystem_client = filesystem.client(args['root_folder'])
        filesystem_doctor = filesystem.doctor(args['root_folder'])
        translate_doctor = translate.doctor(args['webtranslateit_api_key'])
        zendesk_doctor = zendesk.doctor(args['company_uri'], args['user'],
                                        args['password'], filesystem_client,
                                        args['force'])

        zendesk_doctor.fix(categories)
        filesystem_doctor.fix(categories)
        translate_doctor.fix(categories)

        filesystem.saver(args['root_folder']).save(categories)

        print('Done')
示例#9
0
    def execute(self, args):
        print('Running move task...')
        src = os.path.join(args['root_folder'], args['source'])
        dest = os.path.join(args['root_folder'], args['destination'])

        if not os.path.exists(src):
            logging.error('Provided source %s does not exist', src)
            return
        if os.path.exists(dest):
            logging.error('Provided destination %s already exist', dest)
            return

        item = filesystem.loader(args['root_folder']).load_from_path(src)
        zendesk.mover(args['company_uri'], args['user'], args['password'], args['image_cdn']).move(item, dest)
        translate.mover(args['webtranslateit_api_key']).move(item, dest)
        filesystem.mover(args['root_folder']).move(item, dest)
        print('Done')
示例#10
0
    def execute(self, args):
        print('Running move task...')
        src = os.path.join(args['root_folder'], args['source'])
        dest = os.path.join(args['root_folder'], args['destination'])

        if not os.path.exists(src):
            logging.error('Provided source %s does not exist', src)
            return
        if os.path.exists(dest):
            logging.error('Provided destination %s already exist', dest)
            return

        item = filesystem.loader(args['root_folder']).load_from_path(src)
        zendesk.mover(args['company_uri'], args['user'], args['password'],
                      args['image_cdn']).move(item, dest)
        translate.mover(args['webtranslateit_api_key']).move(item, dest)
        filesystem.mover(args['root_folder']).move(item, dest)
        print('Done')
示例#11
0
 def execute(self, args):
     print('Running translate task...')
     categories = filesystem.loader(args['root_folder']).load()
     categories = translate.translator(args['webtranslateit_api_key']).create(categories)
     filesystem.saver(args['root_folder']).save(categories)
     print('Done')