[MediaWiki-commits] [Gerrit] fix last camelcases in utils.py - change (operations/dumps)

2015-09-30 Thread ArielGlenn (Code Review)
ArielGlenn has submitted this change and it was merged.

Change subject: fix last camelcases in utils.py
..


fix last camelcases in utils.py

Change-Id: I9b7e139922e7e0232653f45bf60063f950f64007
---
M xmldumps-backup/dumps/jobs.py
M xmldumps-backup/dumps/utils.py
M xmldumps-backup/worker.py
3 files changed, 47 insertions(+), 50 deletions(-)

Approvals:
  ArielGlenn: Verified; Looks good to me, approved



diff --git a/xmldumps-backup/dumps/jobs.py b/xmldumps-backup/dumps/jobs.py
index 4f42892..364cb3e 100644
--- a/xmldumps-backup/dumps/jobs.py
+++ b/xmldumps-backup/dumps/jobs.py
@@ -758,7 +758,7 @@
 articles_file = runner.dump_dir.filename_public_path(outf)
 history_file = 
runner.dump_dir.filename_public_path(DumpFilename(runner.wiki, outf.date, 
self.history_dump_name, outf.file_type, outf.file_ext, outf.chunk, 
outf.checkpoint, outf.temp))
 current_file = 
runner.dump_dir.filename_public_path(DumpFilename(runner.wiki, outf.date, 
self.current_dump_name, outf.file_type, outf.file_ext, outf.chunk, 
outf.checkpoint, outf.temp))
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpBackup.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpBackup.php")
 
 command = ["/usr/bin/python", "xmlstubs.py", "--config", 
runner.wiki.config.files[0], "--wiki", runner.db_name,
 runner.forceNormalOption(), "--articles", articles_file,
@@ -767,7 +767,6 @@
 if outf.chunk:
 # set up start end end pageids for this piece
 # note there is no page id 0 I guess. so we start with 1
-# start = runner.pagesPerChunk()*(chunk-1) + 1
 start = sum([self._chunks[i] for i in range(0, outf.chunk_int-1)]) 
+ 1
 startopt = "--start=%s" % start
 # if we are on the last chunk, we should get up to the last pageid,
@@ -887,7 +886,7 @@
 output_file_obj = files[0]
 if not exists(runner.wiki.config.php):
 raise BackupError("php command %s not found" % 
runner.wiki.config.php)
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpBackup.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpBackup.php")
 
 logging = runner.dump_dir.filename_public_path(output_file_obj)
 
@@ -1115,7 +1114,7 @@
 else:
 checkpoint_time = ""
 checkpoint_file = ""
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpTextPass.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpTextPass.php")
 dump_command = ["%s" % self.wiki.config.php, "-q"]
 dump_command.extend(script_command)
 dump_command.extend(["--wiki=%s" % runner.db_name,
@@ -1713,14 +1712,12 @@
 if fname.chunk:
 # set up start end end pageids for this piece
 # note there is no page id 0 I guess. so we start with 1
-# start = runner.pagesPerChunk()*(chunk-1) + 1
 start = sum([self._chunks[i] for i in range(0, 
fname.chunk_int-1)]) + 1
 startopt = "--start=%s" % start
 # if we are on the last chunk, we should get up to the last pageid,
 # whatever that is.
 command.append(startopt)
 if fname.chunk_int < len(self._chunks):
-# end = start + runner.pagesPerChunk()
 end = sum([self._chunks[i] for i in range(0, 
fname.chunk_int)]) +1
 endopt = "--end=%s" % end
 command.append(endopt)
diff --git a/xmldumps-backup/dumps/utils.py b/xmldumps-backup/dumps/utils.py
index 9bab8cc..f5b7df7 100644
--- a/xmldumps-backup/dumps/utils.py
+++ b/xmldumps-backup/dumps/utils.py
@@ -12,36 +12,36 @@
 from dumps.exceptions import BackupError
 
 class MultiVersion(object):
-def MWScriptAsString(config, maintenance_script):
-return " ".join(MultiVersion.MWScriptAsArray(config, 
maintenance_script))
+def mw_script_as_string(config, maintenance_script):
+return " ".join(MultiVersion.mw_script_as_array(config, 
maintenance_script))
 
-def MWScriptAsArray(config, maintenance_script):
+def mw_script_as_array(config, maintenance_script):
 mw_script_location = os.path.join(config.wikiDir, "multiversion", 
"MWScript.php")
 if exists(mw_script_location):
 return [mw_script_location, maintenance_script]
 else:
 return ["%s/maintenance/%s" % (config.wikiDir, maintenance_script)]
 
-def MWVersion(config, db_name):
+def mw_version(config, db_name):
 get_version_location = os.path.join(config.wikiDir, "multiversion", 
"getMWVersion")
 if exists(get_version_location):
 # run the command for the wiki and get the version
 command =  get_version_location + " " +  db_name
- 

[MediaWiki-commits] [Gerrit] fix last camelcases in utils.py - change (operations/dumps)

2015-09-30 Thread ArielGlenn (Code Review)
ArielGlenn has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/242490

Change subject: fix last camelcases in utils.py
..

fix last camelcases in utils.py

Change-Id: I9b7e139922e7e0232653f45bf60063f950f64007
---
M xmldumps-backup/dumps/jobs.py
M xmldumps-backup/dumps/utils.py
M xmldumps-backup/worker.py
3 files changed, 47 insertions(+), 50 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/dumps 
refs/changes/90/242490/1

diff --git a/xmldumps-backup/dumps/jobs.py b/xmldumps-backup/dumps/jobs.py
index 4f42892..364cb3e 100644
--- a/xmldumps-backup/dumps/jobs.py
+++ b/xmldumps-backup/dumps/jobs.py
@@ -758,7 +758,7 @@
 articles_file = runner.dump_dir.filename_public_path(outf)
 history_file = 
runner.dump_dir.filename_public_path(DumpFilename(runner.wiki, outf.date, 
self.history_dump_name, outf.file_type, outf.file_ext, outf.chunk, 
outf.checkpoint, outf.temp))
 current_file = 
runner.dump_dir.filename_public_path(DumpFilename(runner.wiki, outf.date, 
self.current_dump_name, outf.file_type, outf.file_ext, outf.chunk, 
outf.checkpoint, outf.temp))
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpBackup.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpBackup.php")
 
 command = ["/usr/bin/python", "xmlstubs.py", "--config", 
runner.wiki.config.files[0], "--wiki", runner.db_name,
 runner.forceNormalOption(), "--articles", articles_file,
@@ -767,7 +767,6 @@
 if outf.chunk:
 # set up start end end pageids for this piece
 # note there is no page id 0 I guess. so we start with 1
-# start = runner.pagesPerChunk()*(chunk-1) + 1
 start = sum([self._chunks[i] for i in range(0, outf.chunk_int-1)]) 
+ 1
 startopt = "--start=%s" % start
 # if we are on the last chunk, we should get up to the last pageid,
@@ -887,7 +886,7 @@
 output_file_obj = files[0]
 if not exists(runner.wiki.config.php):
 raise BackupError("php command %s not found" % 
runner.wiki.config.php)
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpBackup.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpBackup.php")
 
 logging = runner.dump_dir.filename_public_path(output_file_obj)
 
@@ -1115,7 +1114,7 @@
 else:
 checkpoint_time = ""
 checkpoint_file = ""
-script_command = MultiVersion.MWScriptAsArray(runner.wiki.config, 
"dumpTextPass.php")
+script_command = MultiVersion.mw_script_as_array(runner.wiki.config, 
"dumpTextPass.php")
 dump_command = ["%s" % self.wiki.config.php, "-q"]
 dump_command.extend(script_command)
 dump_command.extend(["--wiki=%s" % runner.db_name,
@@ -1713,14 +1712,12 @@
 if fname.chunk:
 # set up start end end pageids for this piece
 # note there is no page id 0 I guess. so we start with 1
-# start = runner.pagesPerChunk()*(chunk-1) + 1
 start = sum([self._chunks[i] for i in range(0, 
fname.chunk_int-1)]) + 1
 startopt = "--start=%s" % start
 # if we are on the last chunk, we should get up to the last pageid,
 # whatever that is.
 command.append(startopt)
 if fname.chunk_int < len(self._chunks):
-# end = start + runner.pagesPerChunk()
 end = sum([self._chunks[i] for i in range(0, 
fname.chunk_int)]) +1
 endopt = "--end=%s" % end
 command.append(endopt)
diff --git a/xmldumps-backup/dumps/utils.py b/xmldumps-backup/dumps/utils.py
index 9bab8cc..f5b7df7 100644
--- a/xmldumps-backup/dumps/utils.py
+++ b/xmldumps-backup/dumps/utils.py
@@ -12,36 +12,36 @@
 from dumps.exceptions import BackupError
 
 class MultiVersion(object):
-def MWScriptAsString(config, maintenance_script):
-return " ".join(MultiVersion.MWScriptAsArray(config, 
maintenance_script))
+def mw_script_as_string(config, maintenance_script):
+return " ".join(MultiVersion.mw_script_as_array(config, 
maintenance_script))
 
-def MWScriptAsArray(config, maintenance_script):
+def mw_script_as_array(config, maintenance_script):
 mw_script_location = os.path.join(config.wikiDir, "multiversion", 
"MWScript.php")
 if exists(mw_script_location):
 return [mw_script_location, maintenance_script]
 else:
 return ["%s/maintenance/%s" % (config.wikiDir, maintenance_script)]
 
-def MWVersion(config, db_name):
+def mw_version(config, db_name):
 get_version_location = os.path.join(config.wikiDir, "multiversion", 
"getMWVersion")
 if exists(get_version_location):
 # run the command for the wiki and get the version