ajventer / pykan Goto Github PK
View Code? Open in Web Editor NEWPure python client for KSP CKAN.
License: GNU General Public License v3.0
Pure python client for KSP CKAN.
License: GNU General Public License v3.0
See below for the command. I'm not sure, but it could be related to the fact that I do not have my KSP installed in a default location. When I run the code in PyKANSettings line by line I end up with a non-existent directory for steamKSPDir.
PS E:\ksp\pyKAN-0.1.0> python .\pyKAN addkspdir --kspdir "E:\KSP\KSP_1.2.1\
python : Traceback (most recent call last)
At line:1 char:1
+ python .\pyKAN addkspdir --kspdir "E:\KSP\KSP_1.2.1\"
+ CategoryInfo : NotSpecified: (Traceback (most recent call last)::String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
File ".\pyKAN", line 341, in <module>
settings = pykancfg.PyKANSettings(kspdir)
File "E:\ksp\pyKAN-0.1.0\libPyKAN\pykancfg.py", line 25, in __init__
steamKSPDir = os.path.join(os.getenv('HOME'),'.local','share','Steam','steamapps','common','Kerbal Space Program')
File "C:\Python34\lib\ntpath.py", line 108, in join
result_drive, result_path = splitdrive(path)
File "C:\Python34\lib\ntpath.py", line 159, in splitdrive
if len(p) > 1:
TypeError: object of type 'NoneType' has no len()`
Hello @ajventer, thank you for your great work :)
I have a couple of requests, they are all optional:
logging
module rather than a DEBUG flagsix
module (available as a standard module on most platforms), and/or using __future__
for basic stuffs)typing
module (see also PEP 526) if you switch to python3.That may sound like a lot of nitpicking (notably about the style), but that would make the source code little bit more readable and would probably find some possible defects. Flake8
is by default configured for a hard line break at 80 chars, but you might want to extend that a little bit (e.g. 100).
Thank you o/
To reproduce
>>> from libPyKAN.version import Version
>>> Version("1.2") <= Version("1.2.1")
False
Breaks installing mods only compatible with 1.2 on 1.2.1 install with minKSPversion set to 1.2.
This is on the TODO list but opening an issue as a reminder. This is one of the most significant bugs to fix before public beta as without it uninstall/upgrade of CKAN installed mods will not work reliably.
Whenever the user does not manually specify a KSPDIR it always uses the steam install - even if this is not the default or not even in the config file.
This behaviour is wrong. Need to fix it.
If a mod is compatible, but it depends on a mod which is not - it should not show up in the compatible filter.
I'm running fresh pyKAN master cloned from this repository, and this happens:
feanor@silmaril ~/D/P/pyKAN> ./pyKAN list_modules
Using KSP Directory: /home/feanor/Development/Kerbal Space Program
Traceback (most recent call last):
File "./pyKAN", line 404, in <module>
options.func(options)
File "./pyKAN", line 164, in list_modules
if modid not in result or Version(result[modid]['version']) < Version(version):
File "/home/feanor/Development/Programming/pyKAN/libPyKAN/version.py", line 111, in __lt__
return self.__cmp__(other) < 0
File "/home/feanor/Development/Programming/pyKAN/libPyKAN/version.py", line 81, in __cmp__
return -other.__cmp__(self)
File "/home/feanor/Development/Programming/pyKAN/libPyKAN/version.py", line 104, in __cmp__
if i > j:
TypeError: '>' not supported between instances of 'int' and 'str'
feanor@silmaril ~/D/P/pyKAN>
I think that this commit ad4e4f4 is the problem, as you fixed incorrect version comparison by trying to convert it to integers, and for some reason it fails to convert to integer for one of the version numbers
This seems to be a problem with upstream sources not having the filename in the URI. Not critical but should be improved for next release.
https://pypi.python.org/pypi/appdirs
Rather than placing the main settings file with $HOME.
Add KSP 1.2.1
./pyKAN addkspdir --kspdir "/home/realgecko/Games/Kerbal Space Program"
./pyKAN list_modules --allmods
Using KSP Directory: /home/realgecko/Games/Kerbal Space Program
Traceback (most recent call last):
File "./pyKAN", line 359, in <module>
actions[options.action]['method']()
File "./pyKAN", line 165, in list_modules
if modid not in result or Version(result[modid]['version']) < Version(version):
File "/home/realgecko/Downloads/pyKAN-0.1.0/libPyKAN/version.py", line 102, in __lt__
return self.__cmp__(other) < 0
File "/home/realgecko/Downloads/pyKAN-0.1.0/libPyKAN/version.py", line 91, in __cmp__
if self.numpart(j) <= self.numpart(i):
File "/home/realgecko/Downloads/pyKAN-0.1.0/libPyKAN/version.py", line 52, in numpart
return int(''.join(re.findall('\d',s)))
ValueError: invalid literal for int() with base 10: ''
Hi,
My reddit name is metalpoetza.
This code is licensed under GPL. This means any derivative HAS to have the same license no matter what. Also, any code that uses your code as a library has to use a GPL license. I was wondering if you could switch to an Apache or BSD-style license. Or possibly this one.
Also: does it have to be PyQT or would Tkinter be acceptable? (I can write a Tkinter GUI fairly easily.)
./pyKAN show_settings
returns the following error:
Traceback (most recent call last):
File "./pyKAN", line 332, in <module>
settings = pykancfg.PyKANSettings(kspdir)
File "~/.local/share/Steam/SteamApps/common/Kerbal Space Program/pyKAN-0.0.1/libPyKAN/pykancfg.py", line 44, in __init__
self.save()
File "~/.local/share/Steam/SteamApps/common/Kerbal Space Program/pyKAN-0.0.1/libPyKAN/pykancfg.py", line 69, in save
util.mkdir_p(os.path.dirname(self.KSPSettingsFile))
AttributeError: 'PyKANSettings' object has no attribute 'KSPSettingsFile'
Is this because I have not assigned a kspdir?
Need to study it's CKAN record and figure out what it needs done differently.
Current algorithm is not very reliable. Could likely work better if simplified.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.