Skip to content

Commit

Permalink
Merge pull request #20 from kloptops/main
Browse files Browse the repository at this point in the history
pugwash: fixed bug with port disk usage calculator, updated translations.
  • Loading branch information
kloptops authored Oct 9, 2023
2 parents d46b3cb + cc5e81b commit b66b53c
Show file tree
Hide file tree
Showing 9 changed files with 865 additions and 705 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ harbourmaster.txt
PortMaster.zip
pylibs.zip
version
do_test.sh

# PortMaster Installer scripts.
makeself*/
Expand Down
11 changes: 4 additions & 7 deletions 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.17'
PORTMASTER_VERSION = '8.4.18'
PORTMASTER_RELEASE_CHANNEL = 'beta'
## -- END PORTMASTER INFO --

Expand Down Expand Up @@ -309,19 +309,18 @@ class DirectoryScanner:
return scan_info[0], True

def _get_directory_size(self, path):
total_size = 0

stack = [path]

while len(stack) > 0:
total_size = 0
path = stack.pop(0)

if path.is_file():
total_size += entry.stat().st_size

elif path.is_dir():
for entry in os.scandir(path):
if entry.name.startswith('.'):
if entry.name in ('.', '..'):
continue

elif entry.is_file():
Expand All @@ -330,9 +329,7 @@ class DirectoryScanner:
elif entry.is_dir():
stack.append(Path(entry.path))

yield total_size

yield total_size
yield total_size

def _calculate_total_size(self, path):
total_size = 0
Expand Down
4 changes: 2 additions & 2 deletions PortMaster/pylibs/harbourmaster/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def json_safe_load(*args):


def fetch(url):
r = requests.get(url, timeout=10)
r = requests.get(url, timeout=20)
if r.status_code != 200:
logger.error(f"Failed to download {url!r}: {r.status_code}")
return None
Expand Down Expand Up @@ -303,7 +303,7 @@ def download(file_name, file_url, md5_source=None, md5_result=None, callback=Non
md5_result = [None]

try:
r = requests.get(file_url, stream=True, timeout=(10, 5))
r = requests.get(file_url, stream=True, timeout=(30, 10))

if r.status_code != 200:
if callback is not None:
Expand Down
Loading

0 comments on commit b66b53c

Please sign in to comment.