Skip to content

Commit

Permalink
CURA-5541 Use the code that was previouly, since the current duplicates
Browse files Browse the repository at this point in the history
some part in the same file.
  • Loading branch information
diegopradogesto committed Jul 27, 2018
1 parent f12ac8b commit a1f00ac
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions UM/PackageManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,14 @@ def initialize(self):
self._installAllScheduledPackages()

# (for initialize) Loads the package management file if exists
def _loadManagementData(self) -> None:
self._bundled_package_dict = {} # type: Dict[str, Dict[str, Any]]
for search_path in Resources.getSearchPaths():
candidate_bundled_path = os.path.join(search_path, "bundled_packages.json")
if os.path.exists(candidate_bundled_path):
# Load the bundled packages:
with open(candidate_bundled_path, "r", encoding = "utf-8") as f:
self._bundled_package_dict.update(json.load(f, encoding = "utf-8"))
Logger.log("i", "Loaded bundled packages data from %s", candidate_bundled_path)
def _loadManagementData(self) -> None: # The bundles package management file should always be there
if not os.path.exists(self._bundled_package_management_file_path):
Logger.log("w", "Bundled package management file could not be found!")
return
# Load the bundled packages:
with open(self._bundled_package_management_file_path, "r", encoding = "utf-8") as f:
self._bundled_package_dict = json.load(f, encoding = "utf-8")
Logger.log("i", "Loaded bundled packages data from %s", self._bundled_package_management_file_path)

# Load the user package management file
if not os.path.exists(self._user_package_management_file_path):
Expand Down

0 comments on commit a1f00ac

Please sign in to comment.