Skip to content
Snippets Groups Projects
Commit c810e9ef authored by Luis Salamanca's avatar Luis Salamanca
Browse files

Adding to correct_xml the possibility of not saving the files

parent 9521f031
No related branches found
No related tags found
No related merge requests found
source diff could not be displayed: it is too large. Options to address this: view the blob.
......@@ -94,6 +94,7 @@ class Document:
if flag_save:
name_tar = utils_proc.addto_tar(name_xml, self.folder_database, name_file = name_outxml)
else:
print('Not saving to tar')
name_tar = self.folder_database + '/' + str(self.year) + '/' + name_outxml + '.tar.gz'
command = 'rm -rf ./' + str(self.year)
......@@ -163,7 +164,7 @@ class Document:
def correct_xml(self, flag_plots = 1, flag_parallel = 0, flag_save_figs = 1,
pages = 'all', suffix_xml = '_data', name_outxml = '02_extractedxml',
name_outcorrxml = '04_correctedxml'):
name_outcorrxml = '04_correctedxml', flag_save = 1):
if 'name_outxml' not in self.__dict__.keys():
self.name_outxml = name_outxml
......@@ -297,7 +298,12 @@ class Document:
tree = ET.ElementTree(XML_new)
tree.write(name_xml, encoding = 'utf-8-sig')
name_tar = utils_proc.addto_tar(name_xml, self.folder_database, name_file = name_outcorrxml)
if flag_save:
name_tar = utils_proc.addto_tar(name_xml, self.folder_database, name_file = name_outcorrxml)
else:
print('Not saving to tar')
name_tar = self.folder_database + '/' + str(self.year) + '/' + name_outcorrxml + '.tar.gz'
self.name_outcorrxml = name_outcorrxml
self.name_xml_corr = [name_tar, name_xml]
command = 'rm -rf ./' + str(self.year)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment