From c97de431f8ec9f3945553fb9116a3389c3dcc440 2013-01-28 17:22:35 From: Matthias BUSSONNIER Date: 2013-01-28 17:22:35 Subject: [PATCH] partial tex fixes --- diff --git a/runme.py b/runme.py index 534aea7..6a6c09b 100755 --- a/runme.py +++ b/runme.py @@ -94,12 +94,15 @@ class NbconvertApp(Application): if self.stdout : print(output.encode('utf-8')) - out_root = ipynb_file[:-6].replace('.','_') + out_root = ipynb_file[:-6].replace('.','_').replace(' ','_') keys = resources.keys() + if self.write : + with io.open(os.path.join(out_root+'.'+'ext'),'w') as f: + f.write(output) if keys : - if self.write and not os.path.exists(out_root): - os.mkdir(out_root) + if self.write and not os.path.exists(out_root+'_files'): + os.mkdir(out_root+'_files') for key in keys: if self.write: with io.open(os.path.join(out_root+'_files',key),'wb') as f: