snaums
/
PiPlayer
Archived
1
0
Fork 0
Simple GUI around OMXPlayer for Raspberry Pi
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 

33 lines
915 B

## @package fileio
# fileio serves as simple interface to store the config-file
import json
## read the config-file and return its values as dictionary
# @param pathname the path to the config-file
# @return dictionary containing the config-information
def getConfig ( pathname ):
data = {};
print (pathname);
try :
with open( pathname, "r+" ) as f:
val = f.read();
try:
data = json.loads(val)
except ValueError:
print ("Oeeehm");
data = {}
except:
pass
return (data);
## save a config-dictionary to a file
# @param pathname the path to the config-file
# @param data dictionary containing config-information
def saveConfig ( pathname, data ):
try:
with open( pathname, 'w') as f:
json.dump(data, f)
except:
print ("Error on Config-save!")
pass