simonduerr commited on
Commit
a6bff4f
·
1 Parent(s): 124f795

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -23,13 +23,13 @@ licenses = ['mit', 'cc-by-3.0', 'cc-0', 'cc-by-4.0', 'bsd', 'cc-by-sa-3.0', 'cc-
23
  categories = ["Machine_Learning", "Genetics", "Chemistry", "Scientific_graphs", "Cell_membrane", "Microbiology", "Oncology", "Molecular_modelling", "Intracellular_components", "Cell_types", "Cell_lines", "Plants_Algae", "Chemo-_and_Bioinformatics", "Cell_culture", "Tissues", "Computer_hardware", "Nucleic_acids", "General_items", "Safety_symbols", "Receptors_channels", "Human_physiology", "Animals", "Lab_apparatus", "Blood_Immunology", "Viruses", "Parasites"]
24
 
25
 
26
- def create_branch(branch_name):
27
  return site.create_git_ref(
28
  'refs/heads/{branch_name}'.format(**locals()),
29
  site.get_branch('main').commit.sha
30
  )
31
 
32
- def create_pull_request(branch_name, github_user):
33
  if github_user!="":
34
  message = f"submitted by: @{github_user}."
35
  else:
@@ -78,7 +78,7 @@ def process_and_create_pull(icon_files,category, new_cateogry_check, new_categor
78
  category = remove_special_chars(new_category)
79
  hash = '{0:010x}'.format(int(time.time() * 256))[:8]
80
  branch_name = f"new-icons-{hash}"
81
- create_branch(branch_name)
82
 
83
  authors = requests.get("https://bioicons.com/icons/authors.json").json()
84
 
@@ -108,7 +108,7 @@ def process_and_create_pull(icon_files,category, new_cateogry_check, new_categor
108
  content=file_content,
109
  branch=branch_name
110
  )
111
- pull = create_pull_request(branch_name, github_user)
112
  return f"""<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.4/flowbite.min.css" rel="stylesheet" />
113
  <div class="flex p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-200 " role="alert">
114
 
 
23
  categories = ["Machine_Learning", "Genetics", "Chemistry", "Scientific_graphs", "Cell_membrane", "Microbiology", "Oncology", "Molecular_modelling", "Intracellular_components", "Cell_types", "Cell_lines", "Plants_Algae", "Chemo-_and_Bioinformatics", "Cell_culture", "Tissues", "Computer_hardware", "Nucleic_acids", "General_items", "Safety_symbols", "Receptors_channels", "Human_physiology", "Animals", "Lab_apparatus", "Blood_Immunology", "Viruses", "Parasites"]
24
 
25
 
26
+ def create_branch(site, branch_name):
27
  return site.create_git_ref(
28
  'refs/heads/{branch_name}'.format(**locals()),
29
  site.get_branch('main').commit.sha
30
  )
31
 
32
+ def create_pull_request(site,branch_name, github_user):
33
  if github_user!="":
34
  message = f"submitted by: @{github_user}."
35
  else:
 
78
  category = remove_special_chars(new_category)
79
  hash = '{0:010x}'.format(int(time.time() * 256))[:8]
80
  branch_name = f"new-icons-{hash}"
81
+ create_branch(site,branch_name)
82
 
83
  authors = requests.get("https://bioicons.com/icons/authors.json").json()
84
 
 
108
  content=file_content,
109
  branch=branch_name
110
  )
111
+ pull = create_pull_request(site,branch_name, github_user)
112
  return f"""<link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/1.6.4/flowbite.min.css" rel="stylesheet" />
113
  <div class="flex p-4 mb-4 text-sm text-green-800 rounded-lg bg-green-200 " role="alert">
114