Exemple #1
0
def should_fetch_git(link_dir, link):
    if is_static_file(link['url']):
        return False

    if os.path.exists(os.path.join(link_dir, 'git')):
        return False

    is_clonable_url = ((domain(link['url']) in GIT_DOMAINS)
                       or (extension(link['url']) == 'git'))
    if not is_clonable_url:
        return False

    return FETCH_GIT
Exemple #2
0
 def process_auto(self, path, from_db=False):
     kind = 'Content' if from_db else 'Curation'
     fname = os.path.basename(path)
     exts = self.settings['archive_extensions'].split(',')
     ext = util.extension(fname, exts)
     if os.path.isfile(path) and ext:
         print(f'{kind} archive ({ext}): {fname}'.ljust(80),
               end='',
               flush=True)
         self.process_archive(path, from_db)
         return
     if not os.path.isdir(path):
         return
     if not util.validate_uuid(fname):
         return
     print(f'{kind} folder: {fname}'.ljust(80), end='', flush=True)
     self.process_game_from_path(fname, path, from_db)