Skip to content

Commit

Permalink
#3 dir cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jschalk committed Aug 23, 2023
1 parent 8b25eac commit 88581f3
Show file tree
Hide file tree
Showing 60 changed files with 84 additions and 76 deletions.
16 changes: 8 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dist/
downloads/
eggs/
.eggs/
# lib/
# src/
lib64/
parts/
sdist/
Expand Down Expand Up @@ -143,10 +143,10 @@ dmypy.json
cython_debug/

# automatically generated testing environments on each run
lib/world/examples/worlds/ex3/
lib/world/examples/worlds/ex4/
lib/world/examples/worlds/ex5/
lib/world/examples/worlds/ex6/
lib/world/examples/worlds/river_env/
lib/world/test_world/sql_worksheet01.sql
lib/agent/examples/js_agent.json
src/world/examples/worlds/ex3/
src/world/examples/worlds/ex4/
src/world/examples/worlds/ex5/
src/world/examples/worlds/ex6/
src/world/examples/worlds/river_env/
src/world/test_world/sql_worksheet01.sql
src/agent/examples/js_agent.json
8 changes: 6 additions & 2 deletions EditMain.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
)


class EditMainViewException(Exception):
pass


class EditMainView(qtw.QWidget, Ui_Form):
"""The settings dialog window"""

Expand Down Expand Up @@ -173,12 +177,12 @@ def acptfact_pick_combo_load(self):

def acptfact_update_heir(self, base_road):
if self.acptfact_update_combo.currentText() == "":
raise Exception("No comboup selection for acptfact update.")
raise EditMainViewException("No comboup selection for acptfact update.")
if (
self.acptfacts_table.item(self.acptfacts_table.currentRow(), 2).text()
is None
):
raise Exception("No table selection for acptfact update.")
raise EditMainViewException("No table selection for acptfact update.")
acptfact_update_combo_text = self.acptfact_update_combo.currentText()
self.agent_x._idearoot._acptfactunits[
base_road
Expand Down
8 changes: 6 additions & 2 deletions main_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
from PyQt5 import QtCore as qtc


class MainAppException(Exception):
pass


class MainApp(QApplication):
"""The main application object"""

Expand Down Expand Up @@ -384,12 +388,12 @@ def _acptfacts_table_set_row_and_2_columns(self, row, base_text, acptfact_text):

def acptfact_update_heir(self, base_road):
if self.acptfact_update_combo.currentText() == "":
raise Exception("No comboup selection for acptfact update.")
raise MainAppException("No comboup selection for acptfact update.")
if (
self.acptfacts_table.item(self.acptfacts_table.currentRow(), 2).text()
is None
):
raise Exception("No table selection for acptfact update.")
raise MainAppException("No table selection for acptfact update.")
acptfact_update_combo_text = self.acptfact_update_combo.currentText()
self.agent_x._idearoot._acptfactunits[
base_road
Expand Down
8 changes: 4 additions & 4 deletions src/world/examples/env_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def get_temp_env_dir():


def get_test_worlds_dir():
return "lib/world/examples/worlds"
return "src/world/examples/worlds"


@pytest_fixture()
Expand Down Expand Up @@ -78,7 +78,7 @@ def create_person_file_for_worlds(world_dir: str, person_name: str):


def get_test_worlds_dir():
return "lib/world/examples/worlds"
return "src/world/examples/worlds"


def create_test_worlds_list():
Expand Down Expand Up @@ -275,7 +275,7 @@ def delete_dir_test_world(world_obj: WorldUnit):

def rename_test_world(world_obj: WorldUnit, new_name):
# base_dir = world_obj.get_object_root_dir()
base_dir = "lib/world/examples/worlds"
base_dir = "src/world/examples/worlds"
src_dir = f"{base_dir}/{world_obj.name}"
dst_dir = f"{base_dir}/{new_name}"
os_rename(src=src_dir, dst=dst_dir)
Expand All @@ -287,7 +287,7 @@ class InvalidWorldCopyException(Exception):


def copy_test_world(src_name: str, dest_name: str):
base_dir = "lib/world/examples/worlds"
base_dir = "src/world/examples/worlds"
new_dir = f"{base_dir}/{dest_name}"
if os_path.exists(new_dir):
raise InvalidWorldCopyException(
Expand Down
2 changes: 1 addition & 1 deletion src/world/examples/person_env_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


def get_temp_person_dir():
return "lib/world/examples/ex_env"
return "src/world/examples/ex_env"


@pytest_fixture()
Expand Down
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex3/persons/w1/w1.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name": "w1", "_env_dir": "lib/world/examples/worlds/ex3", "_person_dir": "lib/world/examples/worlds/ex3/persons/w1", "_public_agents_dir": "lib/world/examples/worlds/ex3/agents", "_digest_agents_dir": "lib/world/examples/worlds/ex3/persons/w1/digests", "_src_agentlinks": {"Myagent": {"agent_desc": "Myagent", "link_type": "blind_trust", "weight": 3}, "bob wurld": {"agent_desc": "bob wurld", "link_type": "ignore", "weight": 1}, "tim wurld": {"agent_desc": "tim wurld", "link_type": "blind_trust", "weight": 1}}, "_dest_agent": {"_kids": {}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}, "_auto_dest_agent_to_public_agent": null}
{"name": "w1", "_env_dir": "src/world/examples/worlds/ex3", "_person_dir": "src/world/examples/worlds/ex3/persons/w1", "_public_agents_dir": "src/world/examples/worlds/ex3/agents", "_digest_agents_dir": "src/world/examples/worlds/ex3/persons/w1/digests", "_src_agentlinks": {"Myagent": {"agent_desc": "Myagent", "link_type": "blind_trust", "weight": 3}, "bob wurld": {"agent_desc": "bob wurld", "link_type": "ignore", "weight": 1}, "tim wurld": {"agent_desc": "tim wurld", "link_type": "blind_trust", "weight": 1}}, "_dest_agent": {"_kids": {}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}, "_auto_dest_agent_to_public_agent": null}
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex3/persons/w2/w2.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name": "w2", "_env_dir": "lib/world/examples/worlds/ex3", "_person_dir": "lib/world/examples/worlds/ex3/persons/w2", "_public_agents_dir": "lib/world/examples/worlds/ex3/agents", "_digest_agents_dir": "lib/world/examples/worlds/ex3/persons/w2/digests", "_src_agentlinks": {}, "_dest_agent": {"_kids": {}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}, "_auto_dest_agent_to_public_agent": null}
{"name": "w2", "_env_dir": "src/world/examples/worlds/ex3", "_person_dir": "src/world/examples/worlds/ex3/persons/w2", "_public_agents_dir": "src/world/examples/worlds/ex3/agents", "_digest_agents_dir": "src/world/examples/worlds/ex3/persons/w2/digests", "_src_agentlinks": {}, "_dest_agent": {"_kids": {}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}, "_auto_dest_agent_to_public_agent": null}
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex5/agents/clay.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 16, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 12, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "clay", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 31, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 5, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "clay", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex5/agents/ernie.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 26, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 7, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "ernie", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 41, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 20, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "ernie", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex5/agents/francine.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 24, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 12, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "francine", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 23, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 23, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "francine", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
2 changes: 1 addition & 1 deletion src/world/examples/worlds/ex5/agents/jessica.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 36, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 40, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "jessica", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
{"_kids": {"casa": {"_kids": {"clean bedroom": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 30, "_desc": "clean bedroom", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}, "clean kitchen": {"_kids": {}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 25, "_desc": "clean kitchen", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": true, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_brandlinks": {}, "_weight": 1, "_desc": "casa", "_uid": null, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_special_road": null, "_numeric_road": null, "promise": false, "_problem_bool": false, "_acptfactunits": {}, "_is_expanded": true, "_on_meld_weight_action": "default"}}, "_requiredunits": {}, "_acptfactunits": {}, "_allys": {}, "_brands": {}, "_brandlinks": {}, "_weight": 1, "_desc": "jessica", "_uid": 1, "_begin": null, "_close": null, "_addin": null, "_numor": null, "_denom": null, "_reest": null, "_problem_bool": false, "_is_expanded": true, "_special_road": null, "_numeric_road": null, "_on_meld_weight_action": "default", "_max_tree_traverse": 3}
Loading

0 comments on commit 88581f3

Please sign in to comment.