Permalink
Browse files

Bugfix of IOError when hyperion.config.json is not present

  • Loading branch information...
1 parent 204ea40 commit a9b6124d1511b60465a725124a0b634344c54de4 Tomasz Szczerba committed Jan 8, 2017
Showing with 7 additions and 2 deletions.
  1. +1 −1 addon.xml
  2. +1 −0 changelog.txt
  3. +5 −1 resources/lib/HyperPyCon.py
View
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.program.hyperion.configurator" name="Hyperion Config Creator" version="1.8.0" provider-name="tociek">
+<addon id="plugin.program.hyperion.configurator" name="Hyperion Config Creator" version="1.8.1" provider-name="tociek">
<requires>
<import addon="xbmc.python" version="2.14.0"/>
</requires>
View
@@ -15,3 +15,4 @@
1.7.1 V4l2 crop default values adjusted for HDMI 4.0 kit
1.7.2 Added BRG color order
1.8.0 Lighberry XL added to led device type
+1.8.1 Bugfix of IOError when hyperion.config.json is not present
@@ -157,7 +157,11 @@ def overwrite_default_config(self):
subprocess.call(["sudo","cp",config_folder+"hyperion.config.json",config_folder+"hyperion.config.json_bak"])
subprocess.call(["sudo","cp",self.new_hyperion_config_path,config_folder+"hyperion.config.json"])
else:
- shutil.copyfile(config_folder+"hyperion.config.json",config_folder+"hyperion.config.json_bak")
+ try:
+ shutil.copyfile(config_folder+"hyperion.config.json",config_folder+"hyperion.config.json_bak")
+ except:
+ """ Ignore IO exception that might occur when there is no hyperion.config.json to backup """
+ pass
shutil.copyfile(self.new_hyperion_config_path,config_folder+"hyperion.config.json")
def config_grabber(self,grabber_model):

0 comments on commit a9b6124

Please sign in to comment.