##// END OF EJS Templates
Write output to current directory, instead of to source directory.
Stefan van der Walt -
Show More
@@ -151,12 +151,13 b' class Converter(object):'
151 def save(self, infile=None, encoding=None):
151 def save(self, infile=None, encoding=None):
152 "read and parse notebook into self.nb"
152 "read and parse notebook into self.nb"
153 if infile is None:
153 if infile is None:
154 infile = os.path.splitext(self.infile)[0] + '.' + self.extension
154 outfile = os.path.basename(self.infile)
155 outfile = os.path.splitext(outfile)[0] + '.' + self.extension
155 if encoding is None:
156 if encoding is None:
156 encoding = self.default_encoding
157 encoding = self.default_encoding
157 with open(infile, 'w') as f:
158 with open(outfile, 'w') as f:
158 f.write(self.output.encode(encoding))
159 f.write(self.output.encode(encoding))
159 return infile
160 return os.path.abspath(outfile)
160
161
161 def optional_header(self):
162 def optional_header(self):
162 return []
163 return []
General Comments 0
You need to be logged in to leave comments. Login now