Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskerPRC committed Nov 26, 2024
1 parent 09d53da commit c4c0ded
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
9 changes: 5 additions & 4 deletions infra_ai_service/service/extract_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ def dealing_with_dsc_content(dir_path: str):

def dealing_with_src_macro_name(src_dir, data_count):
# macro_names
cmd_macro = "grep -E -Irho '\\<[A-Z]+_[A-Z]+\\>' '" + src_dir + ("' | "
"sort | uniq -c | sort -nr | head -10")
cmd_macro = "grep -E -Irho '\\<[A-Z]+_[A-Z]+\\>' '" + src_dir + (
"' | sort | uniq -c | sort -nr | head -10")
macro_str = subprocess.getoutput(cmd_macro)
macro_names = []
if macro_str:
Expand Down Expand Up @@ -520,8 +520,9 @@ def dealing_with_src_path_names(src_dir, data_count):

def dealing_with_src_url_names(src_dir, data_count):
# url_names
cmd_url = ("grep -E -Irho '\"(https?|ftp)://([a-zA-Z0-9-]+\\.)+[a-zA-Z]{"
"2,6}(/.*)?\"' '") + src_dir + "' | sort | uniq -c | sort -nr | head -10"
cmd_url = (("grep -E -Irho '\"(https?|ftp)://([a-zA-Z0-9-]+\\.)+[a-zA-Z]{"
"2,6}(/.*)?\"' '") +
src_dir + "' | sort | uniq -c | sort -nr | head -10")
url_str = subprocess.getoutput(cmd_url)
url_names = []
if url_str:
Expand Down
6 changes: 4 additions & 2 deletions init/init_ubuntu_deb_embeding.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,10 @@
response = requests.post(api_url, json=payload)
if response.status_code == 200:
processed_dsc_urls[dsc_url] = True # 标记为已处理
with open('processed_dsc_urls.json', 'w') as f:
with open('processed_dsc_urls.json',
'w') as f:
json.dump(processed_dsc_urls, f)
else:
print(f"Error posting data for {package_name}: {response.text}")
print(
f"Error posting data for {package_name}: {response.text}")
idx += 1

0 comments on commit c4c0ded

Please sign in to comment.