diff --git a/IPython/nbconvert/nbconvertapp.py b/IPython/nbconvert/nbconvertapp.py index 1c8a62c..3649fda 100755 --- a/IPython/nbconvert/nbconvertapp.py +++ b/IPython/nbconvert/nbconvertapp.py @@ -199,8 +199,8 @@ class NbConvertApp(BaseIPythonApplication): @catch_config_error def initialize(self, argv=None): - super(NbConvertApp, self).initialize(argv) self.init_syspath() + super(NbConvertApp, self).initialize(argv) self.init_notebooks() self.init_writer() self.init_postprocessor() diff --git a/IPython/nbconvert/tests/files/hello.py b/IPython/nbconvert/tests/files/hello.py new file mode 100644 index 0000000..d161b00 --- /dev/null +++ b/IPython/nbconvert/tests/files/hello.py @@ -0,0 +1,7 @@ +from IPython.nbconvert.writers.base import WriterBase + +class HelloWriter(WriterBase): + + def write(self, output, resources, notebook_name=None, **kw): + with open('hello.txt', 'w') as outfile: + outfile.write('hello world') diff --git a/IPython/nbconvert/tests/test_nbconvertapp.py b/IPython/nbconvert/tests/test_nbconvertapp.py index a03c30a..9cb4388 100644 --- a/IPython/nbconvert/tests/test_nbconvertapp.py +++ b/IPython/nbconvert/tests/test_nbconvertapp.py @@ -200,3 +200,12 @@ class TestNbConvertApp(TestsBase): '--PDFPostProcessor.verbose=True') assert os.path.isfile(u'nb1_anĂ¡lisis.tex') assert os.path.isfile(u'nb1_anĂ¡lisis.pdf') + + def test_cwd_plugin(self): + """ + Verify that an extension in the cwd can be imported. + """ + with self.create_temp_cwd(['hello.py']): + self.create_empty_notebook(u'empty.ipynb') + self.call('nbconvert empty --to html --NbConvertApp.writer_class=\'hello.HelloWriter\'') + assert os.path.isfile(u'hello.txt')