[MediaWiki-commits] [Gerrit] additional filtering for value formating - change (analytics/zero-sms)

2014-08-10 Thread Yurik (Code Review)
Yurik has submitted this change and it was merged.

Change subject: additional filtering for value formating
..


additional filtering for value formating

Change-Id: I14488f8868ffaec6a5a6910c623acb2d250d8a02
---
M download.py
M run.cmd
2 files changed, 7 insertions(+), 5 deletions(-)

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



diff --git a/download.py b/download.py
index 7a74d26..ae23a41 100644
--- a/download.py
+++ b/download.py
@@ -105,9 +105,9 @@
 stateBk = self.settingsFilePath + '.bak'
 with open(stateBk, 'wb') as f:
 json.dump(data, f, indent=True, sort_keys=True)
-if os.path.exists(self.statsFilePath):
+if os.path.exists(self.settingsFilePath):
 os.remove(self.settingsFilePath)
-os.rename(stateBk, self.settingsFilePath)
+os.rename(stateBk, self.settingsFilePath)
 
 def parseDate(self, value):
 return datetime.strptime(str(value), self.dateFormat) if 
isinstance(value, basestring) else value
@@ -257,8 +257,9 @@
 tmp = parts[0]
 parts[0] = parts[1]
 parts[1] = tmp\
-.replace(u' [VumiRedis,client] WIKI', u'') \
-.replace(u' [HTTP11ClientProtocol,client] WIKI', u'') \
+.replace(u' [VumiRedis,client]', u'') \
+.replace(u' [HTTP11ClientProtocol,client]', u'') \
+.replace(u' WIKI', u'') \
 .replace(u'+', u'')
 
 if len(parts)  5 and parts[5].startswith(u'content='):
@@ -316,7 +317,7 @@
 if self.enableDownload:
 self.download()
 files = os.listdir(self.dataDir)
-# files = itertools.chain([os.path.join('pc', f) for f in 
os.listdir(os.path.join(self.dataDir, 'pc'))], files)
+files = itertools.chain([os.path.join('pc', f) for f in 
os.listdir(os.path.join(self.dataDir, 'pc'))], files)
 self.combineDataFiles(files)
 
 self.generateGraphData()
diff --git a/run.cmd b/run.cmd
index d438060..9d46628 100644
--- a/run.cmd
+++ b/run.cmd
@@ -1 +1,2 @@
 c:\Python27\python.exe download.py
+pause

-- 
To view, visit https://gerrit.wikimedia.org/r/153268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I14488f8868ffaec6a5a6910c623acb2d250d8a02
Gerrit-PatchSet: 1
Gerrit-Project: analytics/zero-sms
Gerrit-Branch: master
Gerrit-Owner: Yurik yu...@wikimedia.org
Gerrit-Reviewer: Yurik yu...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] additional filtering for value formating - change (analytics/zero-sms)

2014-08-09 Thread Yurik (Code Review)
Yurik has uploaded a new change for review.

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

Change subject: additional filtering for value formating
..

additional filtering for value formating

Change-Id: I14488f8868ffaec6a5a6910c623acb2d250d8a02
---
M download.py
M run.cmd
2 files changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/zero-sms 
refs/changes/68/153268/1

diff --git a/download.py b/download.py
index 7a74d26..ae23a41 100644
--- a/download.py
+++ b/download.py
@@ -105,9 +105,9 @@
 stateBk = self.settingsFilePath + '.bak'
 with open(stateBk, 'wb') as f:
 json.dump(data, f, indent=True, sort_keys=True)
-if os.path.exists(self.statsFilePath):
+if os.path.exists(self.settingsFilePath):
 os.remove(self.settingsFilePath)
-os.rename(stateBk, self.settingsFilePath)
+os.rename(stateBk, self.settingsFilePath)
 
 def parseDate(self, value):
 return datetime.strptime(str(value), self.dateFormat) if 
isinstance(value, basestring) else value
@@ -257,8 +257,9 @@
 tmp = parts[0]
 parts[0] = parts[1]
 parts[1] = tmp\
-.replace(u' [VumiRedis,client] WIKI', u'') \
-.replace(u' [HTTP11ClientProtocol,client] WIKI', u'') \
+.replace(u' [VumiRedis,client]', u'') \
+.replace(u' [HTTP11ClientProtocol,client]', u'') \
+.replace(u' WIKI', u'') \
 .replace(u'+', u'')
 
 if len(parts)  5 and parts[5].startswith(u'content='):
@@ -316,7 +317,7 @@
 if self.enableDownload:
 self.download()
 files = os.listdir(self.dataDir)
-# files = itertools.chain([os.path.join('pc', f) for f in 
os.listdir(os.path.join(self.dataDir, 'pc'))], files)
+files = itertools.chain([os.path.join('pc', f) for f in 
os.listdir(os.path.join(self.dataDir, 'pc'))], files)
 self.combineDataFiles(files)
 
 self.generateGraphData()
diff --git a/run.cmd b/run.cmd
index d438060..9d46628 100644
--- a/run.cmd
+++ b/run.cmd
@@ -1 +1,2 @@
 c:\Python27\python.exe download.py
+pause

-- 
To view, visit https://gerrit.wikimedia.org/r/153268
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I14488f8868ffaec6a5a6910c623acb2d250d8a02
Gerrit-PatchSet: 1
Gerrit-Project: analytics/zero-sms
Gerrit-Branch: master
Gerrit-Owner: Yurik yu...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits