venky2k1 commited on
Commit
6e3deff
Β·
1 Parent(s): eef3533

Final working bug fixer with fixed detection and suggestion

Browse files
Files changed (3) hide show
  1. README.md +1 -1
  2. app_ui.py +3 -3
  3. fix_generator.py +3 -2
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: Bug Fixer
3
- emoji: 🐞
4
  colorFrom: red
5
  colorTo: blue
6
  sdk: gradio
 
1
  ---
2
  title: Bug Fixer
3
+ emoji: "πŸ”§"
4
  colorFrom: red
5
  colorTo: blue
6
  sdk: gradio
app_ui.py CHANGED
@@ -7,11 +7,11 @@ def bug_fixer(code):
7
  fixed_code = generate_fix(code)
8
  return bug_status, fixed_code
9
 
10
- title = "\ud83d\udd27 Bug Detection and Fixing Tool"
11
 
12
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
13
  gr.Markdown("""
14
- # \ud83d\udd27 Bug Detection and Fixing Tool
15
  **Final Year Project - Guided by: Prof. Alakananda K P**
16
  **Team: Akanksha K P and Divyashree N**
17
  """)
@@ -23,5 +23,5 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
23
 
24
  btn.click(fn=bug_fixer, inputs=code_input, outputs=[bug_output, fix_output])
25
 
26
- demo.launch()
27
  #for the gradio user interface
 
7
  fixed_code = generate_fix(code)
8
  return bug_status, fixed_code
9
 
10
+ title = "πŸ”§ Bug Detection and Fixing Tool"
11
 
12
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
13
  gr.Markdown("""
14
+ # πŸ”§ Bug Detection and Fixing Tool
15
  **Final Year Project - Guided by: Prof. Alakananda K P**
16
  **Team: Akanksha K P and Divyashree N**
17
  """)
 
23
 
24
  btn.click(fn=bug_fixer, inputs=code_input, outputs=[bug_output, fix_output])
25
 
26
+ demo.launch(share=True)
27
  #for the gradio user interface
fix_generator.py CHANGED
@@ -2,8 +2,9 @@ def generate_fix(code):
2
  lines = code.split("\n")
3
  fixed_lines = []
4
  for line in lines:
5
- if line.strip().startswith("print ") and not line.strip().startswith("print("):
6
- content = line.strip()[6:].strip()
 
7
  fixed_lines.append(f"print({content})")
8
  else:
9
  fixed_lines.append(line)
 
2
  lines = code.split("\n")
3
  fixed_lines = []
4
  for line in lines:
5
+ line = line.strip()
6
+ if line.startswith("print ") and not line.startswith("print("):
7
+ content = line[6:].strip()
8
  fixed_lines.append(f"print({content})")
9
  else:
10
  fixed_lines.append(line)