Git Product home page Git Product logo

pykan's People

Contributors

ajventer avatar ajventer-tal avatar bblough avatar fronbow avatar minecraft2048 avatar syzygy-dev333 avatar winsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pykan's Issues

Exception on adding a directory

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()`

multi feature request: Python 3 support + style + logging + documentation

Hello @ajventer, thank you for your great work :)

I have a couple of requests, they are all optional:

  • Consider using a Linter for your source (I'd recommend flake8)
  • Consider using the logging module rather than a DEBUG flag
  • Consider supporting python 3 (possibly using the six module (available as a standard module on most platforms), and/or using __future__ for basic stuffs)
  • Consider documenting at all levels (package, module, class, function) using a known doc style (Plain, Epytext, restructuredText, Numpy, Google, etc.)
  • [very optional] Consider using type hints (a.k.a PEP 484) or even the 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/

Version Comparison Broken

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.

Always selects steam

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.

pyKAN list_modules crashes with TypeError

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

ValueError: invalid literal for int() with base 10: ''

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: ''

(Multi) Switch to permissive license? PyQT

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 error

./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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.