##// END OF EJS Templates
pass repr of a list on command line
Paul Ivanov -
Show More
@@ -46,7 +46,7 b' class TestNbConvertApp(TestsBase):'
46 Do search patterns work for notebook names?
46 Do search patterns work for notebook names?
47 """
47 """
48 with self.create_temp_cwd(['notebook*.ipynb']):
48 with self.create_temp_cwd(['notebook*.ipynb']):
49 self.call('nbconvert --to="python" --notebooks=*.ipynb')
49 self.call('nbconvert --to="python" --notebooks=\'["*.ipynb"]\'')
50 assert os.path.isfile('notebook1.py')
50 assert os.path.isfile('notebook1.py')
51 assert os.path.isfile('notebook2.py')
51 assert os.path.isfile('notebook2.py')
52
52
@@ -57,8 +57,8 b' class TestNbConvertApp(TestsBase):'
57 """
57 """
58 with self.create_temp_cwd():
58 with self.create_temp_cwd():
59 self.copy_files_to(['notebook*.ipynb'], 'subdir/')
59 self.copy_files_to(['notebook*.ipynb'], 'subdir/')
60 self.call('nbconvert --to="python"'
60 self.call('nbconvert --to="python" --notebooks='
61 ' --notebooks=%s' % os.path.join('subdir', '*.ipynb'))
61 '\'["%s"]\'' % os.path.join('subdir', '*.ipynb'))
62 assert os.path.isfile('notebook1.py')
62 assert os.path.isfile('notebook1.py')
63 assert os.path.isfile('notebook2.py')
63 assert os.path.isfile('notebook2.py')
64
64
@@ -68,7 +68,8 b' class TestNbConvertApp(TestsBase):'
68 Do explicit notebook names work?
68 Do explicit notebook names work?
69 """
69 """
70 with self.create_temp_cwd(['notebook*.ipynb']):
70 with self.create_temp_cwd(['notebook*.ipynb']):
71 self.call('nbconvert --to="python" --notebooks=notebook2.ipynb')
71 self.call('nbconvert --to="python" --notebooks='
72 '\'["notebook2.ipynb"]\'')
72 assert not os.path.isfile('notebook1.py')
73 assert not os.path.isfile('notebook1.py')
73 assert os.path.isfile('notebook2.py')
74 assert os.path.isfile('notebook2.py')
74
75
@@ -93,8 +94,8 b' class TestNbConvertApp(TestsBase):'
93 Do export templates work?
94 Do export templates work?
94 """
95 """
95 with self.create_temp_cwd(['notebook2.ipynb']):
96 with self.create_temp_cwd(['notebook2.ipynb']):
96 self.call('nbconvert --to=slides --notebooks=notebook2.ipynb'
97 self.call('nbconvert --to=slides --notebooks='
97 ' --template=reveal')
98 '\'["notebook2.ipynb"]\' --template=reveal')
98 assert os.path.isfile('notebook2.slides.html')
99 assert os.path.isfile('notebook2.slides.html')
99 with open('notebook2.slides.html') as f:
100 with open('notebook2.slides.html') as f:
100 assert '/reveal.css' in f.read()
101 assert '/reveal.css' in f.read()
@@ -106,7 +107,7 b' class TestNbConvertApp(TestsBase):'
106 """
107 """
107 with self.create_temp_cwd(['notebook*.ipynb']):
108 with self.create_temp_cwd(['notebook*.ipynb']):
108 self.call('nbconvert --to="python" --notebooks='
109 self.call('nbconvert --to="python" --notebooks='
109 '*.ipynb,notebook1.ipynb,notebook2.ipynb')
110 '\'["*.ipynb","notebook1.ipynb","notebook2.ipynb"]\'')
110 assert os.path.isfile('notebook1.py')
111 assert os.path.isfile('notebook1.py')
111 assert os.path.isfile('notebook2.py')
112 assert os.path.isfile('notebook2.py')
112
113
@@ -117,7 +118,7 b' class TestNbConvertApp(TestsBase):'
117 """
118 """
118 with self.create_temp_cwd(['notebook*.ipynb']):
119 with self.create_temp_cwd(['notebook*.ipynb']):
119 self.call('nbconvert --to="python" --notebooks='
120 self.call('nbconvert --to="python" --notebooks='
120 'notebook1.ipynb,notebook2.ipynb,*.ipynb')
121 '\'["notebook1.ipynb","notebook2.ipynb","*.ipynb"]\'')
121 assert os.path.isfile('notebook1.py')
122 assert os.path.isfile('notebook1.py')
122 assert os.path.isfile('notebook2.py')
123 assert os.path.isfile('notebook2.py')
123
124
@@ -1208,11 +1208,6 b' class Container(Instance):'
1208 raise TraitError(e)
1208 raise TraitError(e)
1209
1209
1210 def validate(self, obj, value):
1210 def validate(self, obj, value):
1211 # Command line arguments come in as strings, let's make them into
1212 # lists so we can proceed with validation
1213 if isinstance(value, basestring):
1214 value = value.split(',')
1215
1216 value = super(Container, self).validate(obj, value)
1211 value = super(Container, self).validate(obj, value)
1217 if value is None:
1212 if value is None:
1218 return value
1213 return value
General Comments 0
You need to be logged in to leave comments. Login now