def run(url): u_obj = common.URL(url) tmp_path_list = u_obj.path[1:-1].split('/') tmp_full_path_list = [] tmp_url = u_obj.netloc + '/' for i in xrange(len(tmp_path_list)): tmp_url = tmp_url + tmp_path_list[i] + '/' tmp_full_path_list.append(tmp_url) task = [] for _u in tmp_full_path_list: if _u not in common.SENSITIVE_LIST: if common.URL(_u).type == 'D': common.SENSITIVE_LIST.append(_u) task.append(threading.Thread(target=svn_check, args=(_u, ))) task.append(threading.Thread(target=git_check, args=(_u, ))) task.append(threading.Thread(target=dir_check, args=(_u, ))) task.append(threading.Thread(target=file_check, args=(_u, ))) for _ in task: _.start() for _ in task: _.join() return True
def run(url): u_obj = common.URL(url) tmp_path_list = u_obj.path[1:-1].split('/') tmp_url = u_obj.netloc + '/' tmp_full_path_list = [tmp_url] while '' in tmp_path_list: tmp_path_list.remove('') if len(tmp_path_list) > 0: for _path in tmp_path_list: tmp_url = tmp_url + _path + '/' tmp_full_path_list.append(tmp_url) task = [] for _u in tmp_full_path_list: if _u not in common.SENSITIVE_LIST: if common.URL(_u).type == 'D': common.SENSITIVE_LIST.append(_u) _u_obj = common.URL(_u) task.append(threading.Thread(target=svn_check, args=(_u_obj,))) task.append(threading.Thread(target=git_check, args=(_u_obj,))) task.append(threading.Thread(target=dir_check, args=(_u_obj,))) task.append(threading.Thread(target=file_check, args=(_u_obj,))) for _ in task: _.start() for _ in task: _.join() return True
def svn_check(url): u = common.URL(url) re = '' check_url = u.value + '.svn/' if requests.get(check_url).status_code != 404: re = '.SVN/' for _ in SVN_DIR: if requests.get(check_url + _).status_code != 404: re = re + _ + ' ' ColorPrint.green(re),
def run(url): u_obj = common.URL(url) if u_obj.type == 'F' and u_obj.value not in common.BACKUPDOWN_LIST: common.BACKUPDOWN_LIST.append(u_obj.value) if '.' + u_obj.filename.split('.')[-1].lower() in INCLUDED_SUFFIX: task = [] task.append(threading.Thread(target=vim_down, args=(u_obj, ))) task.append(threading.Thread(target=gedit_down, args=(u_obj, ))) task.append(threading.Thread(target=back_down, args=(u_obj, ))) for _ in task: _.start() for _ in task: _.join() return True
def run(url): u_obj = common.URL(url) _u = u_obj.scheme + '://' + u_obj.netloc + u_obj.path + u_obj.filename if _u not in common.BACKUPDOWN_LIST: if os.path.splitext(_u)[1].lower() in INCLUDED_SUFFIX: task = [] task.append(threading.Thread(target=VimDown(_u).download, args=())) task.append( threading.Thread(target=GeditDown(_u).download, args=())) for _ in task: _.start() for _ in task: _.join() return True
def dir_check(url): u = common.URL(url) for _ in DIR_LIST: if requests.get(u.value + _[1:]).status_code != 404: ColorPrint.green(_),
def file_check(url): u = common.URL(url) for _ in FILE_LIST: if requests.get(u.value + _).status_code != 404: ColorPrint.green(_),
def git_check(url): u = common.URL(url) if requests.get(u.value + '.git/').status_code != 404: ColorPrint.green('.GIT/'),