Mercurial > kallithea
diff rhodecode/bin/base.py @ 3840:dc4644865e8b beta
Implemented simple gist functionality ref #530.
- creation of public/private gists with given lifetime
- rhodecode-gist CLI for quick gist creation
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 11 May 2013 20:24:02 +0200 |
parents | 5055dd385118 |
children | 5a7d52cf084d |
line wrap: on
line diff
--- a/rhodecode/bin/base.py Sat May 11 00:25:05 2013 +0200 +++ b/rhodecode/bin/base.py Sat May 11 20:24:02 2013 +0200 @@ -35,7 +35,6 @@ Builds API data with given random ID :param random_id: - :type random_id: """ return { "id": random_id, @@ -80,7 +79,9 @@ def __init__(self, config_location=None, autoload=True, autocreate=False, config=None): - self._conf_name = CONFIG_NAME if not config_location else config_location + HOME = os.getenv('HOME', os.getenv('USERPROFILE')) or '' + HOME_CONF = os.path.abspath(os.path.join(HOME, CONFIG_NAME)) + self._conf_name = HOME_CONF if not config_location else config_location self._conf = {} if autocreate: self.make_config(config) @@ -106,7 +107,6 @@ Saves given config as a JSON dump in the _conf_name location :param config: - :type config: """ update = False if os.path.exists(self._conf_name):