[MediaWiki-commits] [Gerrit] dumps: clean up many comments of methods for dumps jobs - change (operations/dumps)
ArielGlenn has submitted this change and it was merged. Change subject: dumps: clean up many comments of methods for dumps jobs .. dumps: clean up many comments of methods for dumps jobs also remove an unused arg (pylint) Change-Id: If0ebbcd0b528ae01ea6211daddbc28e3f836819e --- M xmldumps-backup/dumps/jobs.py 1 file changed, 61 insertions(+), 62 deletions(-) Approvals: ArielGlenn: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/xmldumps-backup/dumps/jobs.py b/xmldumps-backup/dumps/jobs.py index cbd40a0..8bd 100644 --- a/xmldumps-backup/dumps/jobs.py +++ b/xmldumps-backup/dumps/jobs.py @@ -293,7 +293,7 @@ "%s %s" % (compression_command, output_filename)) return recombine_command_string -def cleanup_old_files(self, dump_dir, runner, parts=False): +def cleanup_old_files(self, dump_dir, runner): if "clean_old_files" not in runner.enabled: if self.checkpoint_file is not None: # we only rerun this one, so just remove this one @@ -317,8 +317,8 @@ else: return False -# list all regular output files that exist def list_reg_files(self, dump_dir, dump_names=None, date=None, parts=None): +'''list all regular output files that exist''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -327,8 +327,8 @@ date, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list all checkpoint files that exist def list_checkpt_files(self, dump_dir, dump_names=None, date=None, parts=None): +'''list all checkpoint files that exist''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -337,8 +337,8 @@ date, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list checkpoint files that have been produced for specified file part(s) def list_checkpt_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list checkpoint files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -347,8 +347,8 @@ None, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list noncheckpoint files that have been produced for specified file part(s) def list_reg_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list noncheckpoint files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -357,8 +357,8 @@ None, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list temp output files that have been produced for specified file part(s) def list_temp_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list temp output files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -369,18 +369,21 @@ None, dname, self.file_type, self.file_ext, parts, temp=True)) return files -# internal function which all the public get*Possible functions call -# list all files that could be created for the given dumpname, filtering by the given args. -# by definition, checkpoint files are never returned in such a list, as we don't -# know where a checkpoint might be taken (which pageId start/end). -# -# if we get None for an arg then we accept all values for that arg in the filename -# if we get False for an arg (parts, temp), we reject any filename -# which contains a value for that arg -# if we get True for an arg (temp), we accept only filenames which contain a value for the arg -# parts should be a list of value(s), or True / False / None def _get_files_possible(self, dump_dir, date=None, dumpname=None, file_type=None, file_ext=None, parts=None, temp=False): +''' +internal function which all the public get_*_possible functions call +list all files that could be created for the given dumpname, filtering by the given args. +by definition, checkpoint files are never returned in such a list, as we don't +know where a checkpoint might be taken (which pageId start/end). + +if we get None for an arg then we accept all values for that arg in the filename +if we get False for an arg (parts, temp), we reject any filename +which contains a value for that arg +if we get True for an arg (temp), we accept only filenames which contain a value for the arg +parts should be a list of value(s), or True / False /
[MediaWiki-commits] [Gerrit] dumps: clean up many comments of methods for dumps jobs - change (operations/dumps)
ArielGlenn has uploaded a new change for review. https://gerrit.wikimedia.org/r/252133 Change subject: dumps: clean up many comments of methods for dumps jobs .. dumps: clean up many comments of methods for dumps jobs also remove an unused arg (pylint) Change-Id: If0ebbcd0b528ae01ea6211daddbc28e3f836819e --- M xmldumps-backup/dumps/jobs.py 1 file changed, 62 insertions(+), 63 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/dumps refs/changes/33/252133/1 diff --git a/xmldumps-backup/dumps/jobs.py b/xmldumps-backup/dumps/jobs.py index cbd40a0..a2aefd9 100644 --- a/xmldumps-backup/dumps/jobs.py +++ b/xmldumps-backup/dumps/jobs.py @@ -293,7 +293,7 @@ "%s %s" % (compression_command, output_filename)) return recombine_command_string -def cleanup_old_files(self, dump_dir, runner, parts=False): +def cleanup_old_files(self, dump_dir, runner): if "clean_old_files" not in runner.enabled: if self.checkpoint_file is not None: # we only rerun this one, so just remove this one @@ -315,10 +315,10 @@ else: return range(1, len(self._parts)+1) else: -return False +return [] -# list all regular output files that exist def list_reg_files(self, dump_dir, dump_names=None, date=None, parts=None): +'''list all regular output files that exist''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -327,8 +327,8 @@ date, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list all checkpoint files that exist def list_checkpt_files(self, dump_dir, dump_names=None, date=None, parts=None): +'''list all checkpoint files that exist''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -337,8 +337,8 @@ date, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list checkpoint files that have been produced for specified file part(s) def list_checkpt_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list checkpoint files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -347,8 +347,8 @@ None, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list noncheckpoint files that have been produced for specified file part(s) def list_reg_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list noncheckpoint files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -357,8 +357,8 @@ None, dname, self.file_type, self.file_ext, parts, temp=False)) return files -# list temp output files that have been produced for specified file part(s) def list_temp_files_for_filepart(self, dump_dir, parts, dump_names=None): +'''list temp output files that have been produced for specified file part(s)''' files = [] if not dump_names: dump_names = [self.dumpname] @@ -369,18 +369,21 @@ None, dname, self.file_type, self.file_ext, parts, temp=True)) return files -# internal function which all the public get*Possible functions call -# list all files that could be created for the given dumpname, filtering by the given args. -# by definition, checkpoint files are never returned in such a list, as we don't -# know where a checkpoint might be taken (which pageId start/end). -# -# if we get None for an arg then we accept all values for that arg in the filename -# if we get False for an arg (parts, temp), we reject any filename -# which contains a value for that arg -# if we get True for an arg (temp), we accept only filenames which contain a value for the arg -# parts should be a list of value(s), or True / False / None def _get_files_possible(self, dump_dir, date=None, dumpname=None, file_type=None, file_ext=None, parts=None, temp=False): +''' +internal function which all the public get_*_possible functions call +list all files that could be created for the given dumpname, filtering by the given args. +by definition, checkpoint files are never returned in such a list, as we don't +know where a checkpoint might be taken (which pageId start/end). + +if we get None for an arg then we accept all values for that arg in the filename +if we get False for an arg (parts, temp), we reject any filename +which contains a value for that arg +if we get True for an arg (