##// END OF EJS Templates
Minor changes to a few files to reflect design discussion.
Brian Granger -
Show More
@@ -153,7 +153,7 b' NoDefault = NoDefault()'
153 153 class ArgParseConfigLoader(CommandLineConfigLoader):
154 154
155 155 # arguments = [(('-f','--file'),dict(type=str,dest='file'))]
156 arguments = []
156 arguments = ()
157 157
158 158 def __init__(self, *args, **kw):
159 159 """Create a config loader for use with argparse.
@@ -45,6 +45,7 b' class TestPyFileCL(TestCase):'
45 45 f = os.fdopen(fd, 'w')
46 46 f.write(pyfile)
47 47 f.close()
48 # Unlink the file
48 49 cl = PyFileConfigLoader(fname)
49 50 config = cl.load_config()
50 51 self.assertEquals(config.A, 10)
@@ -58,12 +59,12 b' class TestArgParseCL(TestCase):'
58 59 def test_basic(self):
59 60
60 61 class MyLoader(ArgParseConfigLoader):
61 arguments = [
62 arguments = (
62 63 (('-f','--foo'), dict(dest='FOO', type=str)),
63 64 (('-b',), dict(dest='BAR', type=int)),
64 65 (('-n',), dict(dest='N', action='store_true')),
65 66 (('BAM',), dict(type=str))
66 ]
67 )
67 68
68 69 cl = MyLoader()
69 70 config = cl.load_config('-f hi -b 10 -n wow'.split())
@@ -32,17 +32,19 b' Questions:'
32 32
33 33
34 34 * Can we limit ourselves to 1 config file or do we want to have a sequence
35 of them like IPYTHONDIR->RUNTIMEDIR->CWD?
35 of them like IPYTHONDIR->RUNTIMEDIR->CWD? [1]
36 36 * Do we need a debug mode that has custom exception handling and can drop
37 into pdb upno startup?
37 into pdb upno startup? N
38 38 * Do we need to use an OutputTrap to capture output and then present it
39 to a user if startup fails?
39 to a user if startup fails? N
40 40 * Do we want the location of the config file(s) to be independent of the
41 41 ipython/runtime dir or coupled to it. In other words, can the user select
42 42 a config file that is outside their runtime/ipython dir. One model is
43 43 that we could have a very strict model of IPYTHONDIR=runtimed dir=
44 44 dir used for all config.
45 * Do we install default config files or not?
45 * Do we install default config files or not? N
46
47 * attempt needs to either clash or to die
46 48 """
47 49
48 50 #-----------------------------------------------------------------------------
General Comments 0
You need to be logged in to leave comments. Login now