Mercurial > hg > config
comparison python/hgrc.py @ 480:529fd4e1087e
python/hgrc.py
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 10 Aug 2013 20:35:50 -0700 |
parents | 0a9e1e0d077c |
children | 65e38d33acae |
comparison
equal
deleted
inserted
replaced
479:0a9e1e0d077c | 480:529fd4e1087e |
---|---|
12 import subprocess | 12 import subprocess |
13 import sys | 13 import sys |
14 import urlparse | 14 import urlparse |
15 from ConfigParser import RawConfigParser as ConfigParser | 15 from ConfigParser import RawConfigParser as ConfigParser |
16 | 16 |
17 class section(object): | |
18 def __init__(self, function, section_name, *section_names): | |
19 self.function = function | |
20 self.sections = [section_name] | |
21 self.sections.extend(section_names) | |
22 def __call__(self, parser): | |
23 import pdb; pdb.set_trace() | |
24 | |
17 #@parser # decorator makes this x-form path -> ConfigParser automagically | 25 #@parser # decorator makes this x-form path -> ConfigParser automagically |
18 #@section('paths') | 26 @section('paths') |
19 def set_default(parser, default): | 27 def set_default(parser, default): |
20 """set [paths]:default""" | 28 """set [paths]:default""" |
21 | 29 |
22 def set_default_push(parser, default_push): | 30 def set_default_push(parser, default_push): |
23 """ | 31 """ |