import json
import sys
class ConfReader():
"""
Class used to parse command-line input. Currently holds presets for formatting options
"""
DEFAULT_PRESET = ""
"""
Default formatting if no options are given.
"""
PRESETS = {}
"""
List of all possible formatting presets and their values.
"""
VERSION = "0.9"
"""
Current version of program.
"""
def __init__(self):
"""
Reads configuration file and
"""
config = {"version":"0.9", "default-preset":"custom1", "presets":{"custom1":"%Y%m%d_%H%M%S", "linux1":"%b %d %H:%M:%S"}}
try:
with open("../timediff/timediff.json", "r") as f:
config = json.load(f)
except IOError:
sys.stderr.write("Error loading configuration file timediff.json.\n")
sys.exit(1)
self.DEFAULT_PRESET = config["default-preset"]
self.PRESETS = config["presets"]
class ConfReader
Class used to parse command-line input. Currently holds presets for formatting options
class ConfReader():
"""
Class used to parse command-line input. Currently holds presets for formatting options
"""
DEFAULT_PRESET = ""
"""
Default formatting if no options are given.
"""
PRESETS = {}
"""
List of all possible formatting presets and their values.
"""
VERSION = "0.9"
"""
Current version of program.
"""
def __init__(self):
"""
Reads configuration file and
"""
config = {"version":"0.9", "default-preset":"custom1", "presets":{"custom1":"%Y%m%d_%H%M%S", "linux1":"%b %d %H:%M:%S"}}
try:
with open("../timediff/timediff.json", "r") as f:
config = json.load(f)
except IOError:
sys.stderr.write("Error loading configuration file timediff.json.\n")
sys.exit(1)
self.DEFAULT_PRESET = config["default-preset"]
self.PRESETS = config["presets"]
var DEFAULT_PRESET
Default formatting if no options are given.
var PRESETS
List of all possible formatting presets and their values.
var VERSION
Current version of program.
var DEFAULT_PRESET
var PRESETS
def __init__(
self)
Reads configuration file and
def __init__(self):
"""
eads configuration file and
"""
config = {"version":"0.9", "default-preset":"custom1", "presets":{"custom1":"%Y%m%d_%H%M%S", "linux1":"%b %d %H:%M:%S"}}
try:
with open("../timediff/timediff.json", "r") as f:
config = json.load(f)
except IOError:
sys.stderr.write("Error loading configuration file timediff.json.\n")
sys.exit(1)
self.DEFAULT_PRESET = config["default-preset"]
self.PRESETS = config["presets"]
Documentation generated by
pdoc
0.2.4.
pdoc is in the public domain with the
UNLICENSE.