• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freeseer / freeseer / 376 / 1
59%
master: 59%

Build:
DEFAULT BRANCH: master
Ran 20 Dec 2013 01:43AM UTC
Files 158
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Dec 2013 09:00AM UTC coverage: 51.864% (+1.3%) from 50.602%
376.1

push

travis-ci

mtomwing
Feature #373: Declarative configs and profile / configuration refactor

New concepts:
    - ProfileManager, Profile
    - ConfigStorage, Config, Option

Profiles and Profile Management
===============================

`~/.freeseer/profiles` is now managed by a `ProfileManager`. It handles
creating profiles.

Each profile is now modeled by a `Profile` object. It can be used to get
files from within its folder in a pythonic-manner.

See `freeseer.framework.config.profile`.

Configuration
==============

`FreeseerConfig` and future "configuration classes" have been reworked
to remove needless boilerplate, provide stricter type checking, and
be easily persisted to a file or some other backend. Configs written in
a similar declarative manner like Django or SqlAlchemy models:

    from freeseer.framework.config import Config
    from freeseer.framework.config import options

    class MyConfig(Config):
        name = options.StringOption('foo')
        age = options.IntegerOption()

Upon instantiation, those options can be accessed as if they were
regular class attributes. Any changes to their values will be stored
internally. As you can imagine, values assigned are validated by the
various options (e.g. age only accepts integers).

Persistance of configs is handled by ConfigStorages. I've only
implemented two so far inside `freeseer.framework.config.persist`: one
that uses `ConfigParser` for INI-style files, and one that uses a JSON
file.

    from freeseer.framework.config.persist import ConfigParserStorage

    # load the config, if the file doesn't exist it'll use defaults
    storage = ConfigParserStorage('/tmp/path/to/file.conf')
    config = storage.load(MyConfig(), 'section')

    # make your changes
    config.name = 'michael'
    config.age = 22

    # save them
    storage.store(config, 'section')

This will create a file that looks like:

    [section]
    name = michael
    age = 22

In conjunction with the `Profile` abstraction, you have a nice way of
storing config files inside a profile (e.g. freeseer.conf and
plugins.conf).

10963 of 21138 relevant lines covered (51.86%)

0.52 hits per line

Source Files on job 376.1
  • Tree
  • List 0
  • Changed 17
  • Source Changed 16
  • Coverage Changed 17
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 376
  • Travis Job 376.1
  • efe900af on github
  • Prev Job for on master (#374.1)
  • Next Job for on master (#377.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc