~longsleep/snapcraft/snapcraft-debs-plugin

« back to all changes in this revision

Viewing changes to examples/webcam-webui/config.py

  • Committer: Snappy Tarmac
  • Author(s): Daniel Holbach, Leo Arias
  • Date: 2015-10-05 19:54:20 UTC
  • mfrom: (231.1.9 fix-pep8-and-doc-indentation)
  • Revision ID: snappy_tarmac-20151005195420-w1ql5nndj5413sb5
Fix markdown indentation, make pep8 and pyflakes3 happy. by elopio approved by elopio

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
    if config_yaml:
18
18
        set_config(config_file, config_yaml)
19
19
 
20
 
    yaml.dump(get_config(config_file), stream=sys.stdout, default_flow_style=False)
 
20
    yaml.dump(get_config(config_file), stream=sys.stdout,
 
21
              default_flow_style=False)
21
22
 
22
23
 
23
24
def set_config(config_file, config_yaml={}):
37
38
 
38
39
def _config(config_yaml={}):
39
40
    try:
40
 
        interval_value = config_yaml['config'][os.environ['SNAP_NAME']]['interval']
 
41
        interval_value = config_yaml['config'][
 
42
            os.environ['SNAP_NAME']]['interval']
41
43
        if not isinstance(interval_value, int):
42
 
            config_yaml['config'][os.environ['SNAP_NAME']]['interval'] = _DEFAULT_INTERVAL
 
44
            config_yaml['config'][
 
45
                os.environ['SNAP_NAME']]['interval'] = _DEFAULT_INTERVAL
43
46
    except KeyError:
44
47
        interval = {
45
48
            'config': {