Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Sparse JSON based config files with GUI editor.

Project Description

jsonConfig is a Python package that provides sparse JSON based config files with GUI editor. The config files are referred to as being sparse because only those settings which are different than the default values are stored in the config files. Default config options are defined programmatically which allows defaults to be updated with out overwriting a users options.

Usage

Creating defaults

from jsonConfig import *

cfg = Config()
cfg.add_setting( 'Category 1', 'option1', 'Value1', alias = 'Option #1', options = ['Value1', 'Value2'], type = CT_COMBO, about = 'An example option.' )
cfg.add_setting( 'Category 1', 'option2', True, alias = 'Option #2', type = CT_CHECKBOX )
cfg.add_setting( 'Category 2', 'option1', 'value', type = CT_LINEEDIT)

Accessing values

>>> cfg
{'Category 2': {'option1': 'value'}, 'Category 1': {'option2': True, 'option1': 'Value1'}}

>>> cfg['Category 1']['option1']
'Value1'

Loading config file

config.json

{
  "Category 1": {
    "option1": {
      "value": "Value2"
    }
  }
}
cfg.set_user_file("config.json")
>>> cfg
{'Category 2': {'option1': 'value'}, 'Category 1': {'option2': True, 'option1': 'Value2'}}

GUI Editor

from PySide.QtGui import *
from jsonConfig import ConfigEditor

app = QApplication([])
editor = ConfigEditor(app, cfg, 'Demo Config Editor')
editor.setup()
app.exec_()
Release History

Release History

This version
History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
jsonConfig-0.1.2.tar.gz (15.8 kB) Copy SHA256 Checksum SHA256 Source Oct 12, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting