Skip to content

Commit

Permalink
Merge pull request #24 from kloptops/main
Browse files Browse the repository at this point in the history
Fixed performance issues and runtime manager.
  • Loading branch information
kloptops authored Oct 26, 2023
2 parents 712598e + 30afad6 commit be9bf09
Show file tree
Hide file tree
Showing 16 changed files with 1,278 additions and 1,129 deletions.
5 changes: 4 additions & 1 deletion PortMaster/pugwash
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3

## -- BEGIN PORTMASTER INFO --
PORTMASTER_VERSION = '8.4.21'
PORTMASTER_VERSION = '8.4.22'
PORTMASTER_RELEASE_CHANNEL = 'beta'
## -- END PORTMASTER INFO --

Expand Down Expand Up @@ -329,6 +329,9 @@ class DirectoryScanner:
elif entry.is_dir():
stack.append(Path(entry.path))

yield total_size
total_size = 0

yield total_size

def _calculate_total_size(self, path):
Expand Down
2 changes: 1 addition & 1 deletion PortMaster/pylibs/default_theme/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@
"pointer-flip-y": false
},
"option_description": {
"text": "Name: {runtime_info.name}\nStatus: {runtime_info.status}\nPorts: {runtime_info.ports}\nVerified: {runtime_info.verified}\nDownload Size: {runtime_info.download_size}\nInstall Size: {runtime_info.disk_size}",
"text": "Name: {runtime_info.name}\nStatus: {runtime_info.status}\nPorts: {runtime_info.ports}\nDownload Size: {runtime_info.download_size}\nInstall Size: {runtime_info.disk_size}",
"font-size": 25,
"font-color": "general_font",
"area": [ 0.5, 0.3, 1.0, 0.85 ],
Expand Down
8 changes: 8 additions & 0 deletions PortMaster/pylibs/harbourmaster/harbour.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, config, *, tools_dir=None, ports_dir=None, temp_dir=None, cal
"""
config = load_config()
"""
self.__PORT_INFO_CACHE = {}

if tools_dir is None:
tools_dir = HM_TOOLS_DIR
Expand Down Expand Up @@ -409,6 +410,7 @@ def load_ports(self):
file_renames = {}

ports_info = self.ports_info()
self.__PORT_INFO_CACHE.clear()

self.callback.message(" - {}".format(_("Loading Ports.")))

Expand Down Expand Up @@ -933,6 +935,10 @@ def porters_list(self):
def port_info(self, port_name, installed=False):
result = None

port_key = (name_cleaner(port_name), installed)
if port_key in self.__PORT_INFO_CACHE:
return self.__PORT_INFO_CACHE[port_key]

if installed:
if port_name in self.installed_ports:
result = port_info_load(self.installed_ports[name_cleaner(port_name)])
Expand All @@ -949,6 +955,7 @@ def port_info(self, port_name, installed=False):
result = port_info_load(source.port_info(port_name))

if result is None:
self.__PORT_INFO_CACHE[port_key] = result
return None

if not installed:
Expand All @@ -958,6 +965,7 @@ def port_info(self, port_name, installed=False):
elif port_name in self.broken_ports:
port_info_merge(result, self.broken_ports[name_cleaner(port_name)])

self.__PORT_INFO_CACHE[port_key] = result
return result

def port_download_size(self, port_name, check_runtime=True):
Expand Down
Loading

0 comments on commit be9bf09

Please sign in to comment.