ripple-down-rules 0.5.61__py3-none-any.whl → 0.5.63__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ripple_down_rules/__init__.py +1 -1
- ripple_down_rules/experts.py +1 -1
- ripple_down_rules/user_interface/template_file_creator.py +7 -2
- {ripple_down_rules-0.5.61.dist-info → ripple_down_rules-0.5.63.dist-info}/METADATA +1 -1
- {ripple_down_rules-0.5.61.dist-info → ripple_down_rules-0.5.63.dist-info}/RECORD +8 -8
- {ripple_down_rules-0.5.61.dist-info → ripple_down_rules-0.5.63.dist-info}/WHEEL +0 -0
- {ripple_down_rules-0.5.61.dist-info → ripple_down_rules-0.5.63.dist-info}/licenses/LICENSE +0 -0
- {ripple_down_rules-0.5.61.dist-info → ripple_down_rules-0.5.63.dist-info}/top_level.txt +0 -0
ripple_down_rules/__init__.py
CHANGED
ripple_down_rules/experts.py
CHANGED
@@ -155,7 +155,7 @@ class Expert(ABC):
|
|
155
155
|
func_source = encapsulate_user_input(func_source, CallableExpression.get_encapsulating_function(f'_{uid}'))
|
156
156
|
else:
|
157
157
|
func_source = 'pass # No user input provided for this case.\n'
|
158
|
-
if func_source[1:] in current_file_data:
|
158
|
+
if current_file_data is not None and func_source[1:] in current_file_data:
|
159
159
|
continue
|
160
160
|
f.write(imports + func_source + '\n' + '\n\n\n\'===New Answer===\'\n\n\n')
|
161
161
|
|
@@ -84,6 +84,7 @@ class TemplateFileCreator:
|
|
84
84
|
self.func_doc: str = self.get_func_doc()
|
85
85
|
self.function_signature: str = self.get_function_signature()
|
86
86
|
self.editor: Optional[Editor] = detect_available_editor()
|
87
|
+
self.editor_cmd: Optional[str] = os.environ.get("RDR_EDITOR_CMD")
|
87
88
|
self.workspace: str = os.environ.get("RDR_EDITOR_WORKSPACE", os.path.dirname(self.case_query.scope['__file__']))
|
88
89
|
self.temp_file_path: str = os.path.join(self.workspace, "edit_code_here.py")
|
89
90
|
|
@@ -98,7 +99,7 @@ class TemplateFileCreator:
|
|
98
99
|
return make_list(output_type) if output_type is not None else None
|
99
100
|
|
100
101
|
def edit(self):
|
101
|
-
if self.editor is None:
|
102
|
+
if self.editor is None and self.editor_cmd is None:
|
102
103
|
self.print_func(
|
103
104
|
f"{Fore.RED}ERROR:: No editor found. Please install PyCharm, VSCode or code-server.{Style.RESET_ALL}")
|
104
105
|
return
|
@@ -112,7 +113,11 @@ class TemplateFileCreator:
|
|
112
113
|
"""
|
113
114
|
Open the file in the available editor.
|
114
115
|
"""
|
115
|
-
if self.
|
116
|
+
if self.editor_cmd is not None:
|
117
|
+
subprocess.Popen([self.editor_cmd, self.temp_file_path],
|
118
|
+
stdout=subprocess.DEVNULL,
|
119
|
+
stderr=subprocess.DEVNULL)
|
120
|
+
elif self.editor == Editor.Pycharm:
|
116
121
|
subprocess.Popen(["pycharm", "--line", str(self.user_edit_line), self.temp_file_path],
|
117
122
|
stdout=subprocess.DEVNULL,
|
118
123
|
stderr=subprocess.DEVNULL)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: ripple_down_rules
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.63
|
4
4
|
Summary: Implements the various versions of Ripple Down Rules (RDR) for knowledge representation and reasoning.
|
5
5
|
Author-email: Abdelrhman Bassiouny <abassiou@uni-bremen.de>
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
@@ -1,5 +1,5 @@
|
|
1
|
-
ripple_down_rules/__init__.py,sha256=
|
2
|
-
ripple_down_rules/experts.py,sha256=
|
1
|
+
ripple_down_rules/__init__.py,sha256=YhwbkV_b1omD9-l5j4yNuD_J1TW_-QiK-vnUMHGzxk4,100
|
2
|
+
ripple_down_rules/experts.py,sha256=bwozulI1rv0uyaMZQqEgapDO-s8wvW0D6Jqxmvu5fik,12610
|
3
3
|
ripple_down_rules/helpers.py,sha256=TvTJU0BA3dPcAyzvZFvAu7jZqsp8Lu0HAAwvuizlGjg,2018
|
4
4
|
ripple_down_rules/rdr.py,sha256=4iobla4XmMwAOQsn_JZaZe2tWU0aMMvqgzP5WavIagI,49280
|
5
5
|
ripple_down_rules/rdr_decorators.py,sha256=bmn4h4a7xujTVxu-ofECe71cM_6iiqZhLVFosEItid4,7602
|
@@ -16,9 +16,9 @@ ripple_down_rules/user_interface/gui.py,sha256=jRRyQxgU_RK2e_wgi2gPag_FB8UCYOAXi
|
|
16
16
|
ripple_down_rules/user_interface/ipython_custom_shell.py,sha256=24MIFwqnAhC6ofObEO6x5xRWRnyQmPpPmTvxbCKBrzM,6514
|
17
17
|
ripple_down_rules/user_interface/object_diagram.py,sha256=tsB6iuLNEbHxp5lR2WjyejjWbnAX_nHF9xS8jNPOQVk,4548
|
18
18
|
ripple_down_rules/user_interface/prompt.py,sha256=AkkltdDIaioN43lkRKDPKSjJcmdSSGZDMYz7AL7X9lE,8082
|
19
|
-
ripple_down_rules/user_interface/template_file_creator.py,sha256=
|
20
|
-
ripple_down_rules-0.5.
|
21
|
-
ripple_down_rules-0.5.
|
22
|
-
ripple_down_rules-0.5.
|
23
|
-
ripple_down_rules-0.5.
|
24
|
-
ripple_down_rules-0.5.
|
19
|
+
ripple_down_rules/user_interface/template_file_creator.py,sha256=xw0NIFILMA4rvEqvOznefRqLOpS-UoWa3c9b-HfhVWQ,14129
|
20
|
+
ripple_down_rules-0.5.63.dist-info/licenses/LICENSE,sha256=ixuiBLtpoK3iv89l7ylKkg9rs2GzF9ukPH7ynZYzK5s,35148
|
21
|
+
ripple_down_rules-0.5.63.dist-info/METADATA,sha256=iS7z9EkWKtPgrDISnU-4OMcqvp0EsZeoskZK1Da5UuI,48189
|
22
|
+
ripple_down_rules-0.5.63.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
23
|
+
ripple_down_rules-0.5.63.dist-info/top_level.txt,sha256=VeoLhEhyK46M1OHwoPbCQLI1EifLjChqGzhQ6WEUqeM,18
|
24
|
+
ripple_down_rules-0.5.63.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|