sailoog / openplotter

Obsolete project. New one and active: https://github.com/openplotter
http://www.sailoog.com/openplotter
GNU General Public License v2.0
153 stars 53 forks source link

In v2.x.x, openplotter crash when ~/.signalk is missing #250

Open FredericGuilbault opened 5 years ago

FredericGuilbault commented 5 years ago

On my install, signalk run under it's own user. So I don't have any ~/.signalK for the user of openplotter. This make openplotter crash like this:

Traceback (most recent call last):
  File "./openplotter", line 4157, in <module>
    MainFrame().Show()
  File "./openplotter", line 50, in __init__
    self.SK_settings = SK_settings()
  File "/var/www/openplotter/classes/SK_settings.py", line 28, in __init__
    self.load()
  File "/var/www/openplotter/classes/SK_settings.py", line 102, in load
    if not OPcan: self.data['pipedProviders'].append({'pipeElements': [{'type': 'providers/simple', 'options': {'logging': False, 'type': 'NMEA2000', 'subOptions': {'device': '/dev/ttyOP_', 'type': 'ngt-1'}}}], 'enabled': False, 'id': 'OPcan'})
KeyError: 'pipedProviders'

1) it should not make openplotter crash, 2) The Folder location variable should not imply every services that Openplotter manage run under the same user. (self.home+'/.signalk/settings.json')


This is what im gonna work on in the next days.

FredericGuilbault commented 5 years ago

My work branch for the bug fix is here: https://github.com/FredericGuilbault/openplotter/tree/bug/handle_missing_signalkConfFile

And the branch for the setting here: https://github.com/FredericGuilbault/openplotter/tree/feature/choose_SK_confFile_location

FredericGuilbault commented 5 years ago

@sailoog inclasses/conf.py Should I use Conf or Conf2 ?