Conversation
|
@HebaruSan Can you run the github checks again? I don't have the ability to run them on my end, and I'd like to make sure this works (and so that I can begin using it if it gets merged) |
| for ckan in self.ckm_repo.all_latest_modules(): # pylint: disable=too-many-nested-blocks | ||
| if ckan.kind == 'dlc': | ||
| continue | ||
| nk = Netkan(self.nk_repo.nk_path(ckan.identifier), game_id=self.game_id) |
There was a problem hiding this comment.
This needs to be able to handle mods that don't have netkans, or for which the netkans are renamed to .frozen. (Note that some of the .frozen files are not valid netkans, e.g. https://github.com/KSP-CKAN/NetKAN/blob/master/NetKAN/BananaForScale.frozen.)
I think it would crash at this point.
There was a problem hiding this comment.
Confirmed; here's what those errors look like:
Traceback (most recent call last):
File "/home/netkan/.local/bin/netkan", line 6, in <module>
sys.exit(netkan())
^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 1485, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 1406, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 1873, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 1269, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/decorators.py", line 93, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/click/core.py", line 824, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/netkan/cli/utilities.py", line 64, in download_counter
common.token).update_counts()
^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/netkan/download_counter.py", line 402, in update_counts
self.get_counts()
File "/home/netkan/.local/lib/python3.12/site-packages/netkan/download_counter.py", line 310, in get_counts
nk = Netkan(self.nk_repo.nk_path(ckan.identifier), game_id=self.game_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/netkan/.local/lib/python3.12/site-packages/netkan/metadata.py", line 33, in __init__
self.contents = self.filename.read_text(encoding='UTF-8')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 1029, in read_text
with self.open(mode='r', encoding=encoding, errors=errors) as f:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/pathlib.py", line 1015, in open
return io.open(self, mode, buffering, encoding, errors, newline)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/ksp/NetKAN/NetKAN/sidosUraniaSystem.netkan'
There was a problem hiding this comment.
I pushed a commit that checks if the netkan file exists first, which is also done by auto_freezer.py in a very similar way. Should account for both situations?
When x_netkan_check_parent_downloads is false, do not check the github parent repos for the download count. Defaults to true. (the current behavior)
Unsure of how to test this to make sure it works.