+ fix while
This commit is contained in:
24
gui/gui.py
24
gui/gui.py
@@ -94,12 +94,12 @@ class Gui:
|
|||||||
|
|
||||||
if event == '-OUTPUT FOLDER-':
|
if event == '-OUTPUT FOLDER-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
' value = ' + str(values['-OUTPUT FOLDER-'])))
|
||||||
fnames = output(values)
|
fnames = output(values)
|
||||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||||
elif event == '-OUTPUT FILE LIST-':
|
elif event == '-OUTPUT FILE LIST-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
' value = ' + str(values['-OUTPUT FILE LIST-'])))
|
||||||
try:
|
try:
|
||||||
filename = os.path.join(
|
filename = os.path.join(
|
||||||
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
values["-OUTPUT FOLDER-"], values["-OUTPUT FILE LIST-"][0]
|
||||||
@@ -110,13 +110,13 @@ class Gui:
|
|||||||
pass
|
pass
|
||||||
if event == '-JAVA FOLDER-':
|
if event == '-JAVA FOLDER-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
' value = ' + str(values['-JAVA FOLDER-'])))
|
' value = ' + str(values['-JAVA FOLDER-'])))
|
||||||
folder = values['-JAVA FOLDER-']
|
folder = values['-JAVA FOLDER-']
|
||||||
window['-JAVA FOLDER-'].update(values['-JAVA FILE-'])
|
window['-JAVA FOLDER-'].update(values['-JAVA FILE-'])
|
||||||
|
|
||||||
elif event == '-CREATE-':
|
elif event == '-CREATE-':
|
||||||
logging.debug(('event = ' + str(event) +
|
logging.debug(('event = ' + str(event) +
|
||||||
'values = ' + str(values)))
|
'values = ' + str(values)))
|
||||||
try:
|
try:
|
||||||
if values['-JAVA FOLDER-'] and values['-OUTPUT FOLDER-']:
|
if values['-JAVA FOLDER-'] and values['-OUTPUT FOLDER-']:
|
||||||
logging.debug(
|
logging.debug(
|
||||||
@@ -132,21 +132,25 @@ class Gui:
|
|||||||
window['-OUTPUT FILE LIST-'].update(fnames)
|
window['-OUTPUT FILE LIST-'].update(fnames)
|
||||||
sg.popup_notify('Succsessful created!',
|
sg.popup_notify('Succsessful created!',
|
||||||
title='Created')
|
title='Created')
|
||||||
|
|
||||||
except JavaSyntaxError as JsE:
|
except JavaSyntaxError as JsE:
|
||||||
logging.error(('||SyntaxError in Java File|| Failed to create Image with values = ' + str(values)))
|
logging.error(
|
||||||
|
('||SyntaxError in Java File|| Failed to create Image with values = ' + str(values)))
|
||||||
sg.popup_error((str(JsE)))
|
sg.popup_error((str(JsE)))
|
||||||
except ScopeNotFoundException as SnFe:
|
except ScopeNotFoundException as SnFe:
|
||||||
logging.error(('||ScopeNotFoundExeption|| Failed to create Image with values = ' + str(values)))
|
logging.error(
|
||||||
|
('||ScopeNotFoundExeption|| Failed to create Image with values = ' + str(values)))
|
||||||
sg.popup_error((str(SnFe)))
|
sg.popup_error((str(SnFe)))
|
||||||
except FileNotFoundError as FnFe:
|
except FileNotFoundError as FnFe:
|
||||||
logging.error(('||FileNotFoundError|| Failed to create Image with values = ' + str(values)))
|
logging.error(
|
||||||
sg.popup_error((str(FnFe) + 'File ' + str(file_path) + ' or ' + str(output_path) + ' is not reachable.'))
|
('||FileNotFoundError|| Failed to create Image with values = ' + str(values)))
|
||||||
|
sg.popup_error(
|
||||||
|
(str(FnFe) + 'File ' + str(file_path) + ' or ' + str(output_path) + ' is not reachable.'))
|
||||||
except:
|
except:
|
||||||
logging.error(
|
logging.error(
|
||||||
('Failed to create Image with values = ' + str(values)))
|
('Failed to create Image with values = ' + str(values)))
|
||||||
sg.popup_error(('Failed to create an image. '))
|
sg.popup_error(('Failed to create an image. '))
|
||||||
raise
|
raise
|
||||||
|
|
||||||
elif values['-JAVA FOLDER-']:
|
elif values['-JAVA FOLDER-']:
|
||||||
logging.error('No Output')
|
logging.error('No Output')
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ def get_instructions_in_scope(src: List[str], start_idx: int = 0) -> Tuple[List[
|
|||||||
brace_offset = get_scope_start_offset(src, i)
|
brace_offset = get_scope_start_offset(src, i)
|
||||||
child_instructions, i = get_instructions_in_scope(src, i+brace_offset)
|
child_instructions, i = get_instructions_in_scope(src, i+brace_offset)
|
||||||
|
|
||||||
outer_scope.append(while_instruction_front(instruction_txt, child_instructions))
|
outer_scope.append(while_instruction_front(('while ' + instruction_txt), child_instructions))
|
||||||
|
|
||||||
elif line.startswith("if("):
|
elif line.startswith("if("):
|
||||||
logging.debug("Found if instruction in line: %i", i+1)
|
logging.debug("Found if instruction in line: %i", i+1)
|
||||||
@@ -91,7 +91,7 @@ def get_instructions_in_scope(src: List[str], start_idx: int = 0) -> Tuple[List[
|
|||||||
bracket_idx = end_line.rindex(");")
|
bracket_idx = end_line.rindex(");")
|
||||||
instruction_txt = end_line[7: bracket_idx]
|
instruction_txt = end_line[7: bracket_idx]
|
||||||
|
|
||||||
outer_scope.append(while_instruction_back(instruction_txt, child_instructions))
|
outer_scope.append(while_instruction_back(('do while' + instruction_txt), child_instructions))
|
||||||
|
|
||||||
else:
|
else:
|
||||||
logging.debug("Found generic instruction in line: %i", i+1)
|
logging.debug("Found generic instruction in line: %i", i+1)
|
||||||
|
|||||||
Reference in New Issue
Block a user