##// END OF EJS Templates
Merge pull request #3 from stefanv/fix_output_path...
Fernando Perez -
r6683:74775b4c merge
parent child Browse files
Show More
@@ -157,12 +157,13 class Converter(object):
157 def save(self, infile=None, encoding=None):
157 def save(self, infile=None, encoding=None):
158 "read and parse notebook into self.nb"
158 "read and parse notebook into self.nb"
159 if infile is None:
159 if infile is None:
160 infile = os.path.splitext(self.infile)[0] + '.' + self.extension
160 outfile = os.path.basename(self.infile)
161 outfile = os.path.splitext(outfile)[0] + '.' + self.extension
161 if encoding is None:
162 if encoding is None:
162 encoding = self.default_encoding
163 encoding = self.default_encoding
163 with open(infile, 'w') as f:
164 with open(outfile, 'w') as f:
164 f.write(self.output.encode(encoding))
165 f.write(self.output.encode(encoding))
165 return infile
166 return os.path.abspath(outfile)
166
167
167 def optional_header(self):
168 def optional_header(self):
168 return []
169 return []
General Comments 0
You need to be logged in to leave comments. Login now