def run_action(self, src_file, output_dir): """Call this method to execute the desired action (--make-news). It will run the necessary methods.""" copyfile(src_file, os.path.join(self.tempdir, 'NEWS')) src_file = os.path.join(self.tempdir, 'NEWS') html_file = self.compile_src(src_file) if not html_file: print('ERROR: Could not compile HTML version.', file=sys.stderr) else: atom_file = self.compile_atom() include_list = [src_file, html_file, atom_file] self.make_tarball(include_list, output_dir) remove_temporary_dir(self.tempdir, self.verbosity)
def install_files(self): """Copy extracted NEWS files to their intended locations.""" try: copyfile(os.path.join(self.tempdir, 'NEWS'), self.local_news) for newsfile in ['NEWS.html', 'NEWS.atom']: copyfile(os.path.join(self.tempdir, newsfile), os.path.join(self.tahoe_node_dir, self.web_static, newsfile)) except (IOError, os.error): print("ERROR: Couldn't copy one or more NEWS files into the " "node directory.", file=sys.stderr) else: if self.verbosity > 2: print('DEBUG: Copied NEWS files into the node directory.') finally: remove_temporary_dir(self.tempdir, self.verbosity)
def install_files(self): """Copy extracted NEWS files to their intended locations.""" try: copyfile(os.path.join(self.tempdir, 'NEWS'), self.local_news) for newsfile in ['NEWS.html', 'NEWS.atom']: copyfile( os.path.join(self.tempdir, newsfile), os.path.join(self.tahoe_node_dir, self.web_static, newsfile)) except (IOError, os.error): print( "ERROR: Couldn't copy one or more NEWS files into the " "node directory.", file=sys.stderr) else: if self.verbosity > 2: print('DEBUG: Copied NEWS files into the node directory.') finally: remove_temporary_dir(self.tempdir, self.verbosity)
def tearDown(self): functions.remove_temporary_dir(self.tempdir)
def tearDown(self): functions.remove_temporary_dir(self.tempdir) sys.stdout = self.oldstdout