Milimetric has uploaded a new change for review.

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

Change subject: Use os.path instead of path.path
......................................................................

Use os.path instead of path.path

Change-Id: If6742289cc460169ed9cdf6be48969e292a7ce1d
---
M scripts/aggregate-and-filter-sessions.py
1 file changed, 7 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/limn-edit-data 
refs/changes/46/315946/1

diff --git a/scripts/aggregate-and-filter-sessions.py 
b/scripts/aggregate-and-filter-sessions.py
index 82b35ae..f444604 100644
--- a/scripts/aggregate-and-filter-sessions.py
+++ b/scripts/aggregate-and-filter-sessions.py
@@ -14,13 +14,13 @@
 import csv
 import glob
 import sys
+import os
 
-from path import path
 from collections import OrderedDict, defaultdict
 from datetime import datetime, timedelta
 
-INPUT_DIR = path(sys.argv[1]).abspath()
-OUTPUT_DIR = path(sys.argv[2]).abspath()
+INPUT_DIR = os.path.abspath(sys.argv[1])
+OUTPUT_DIR = os.path.abspath(sys.argv[2])
 DATE_FORMAT = '%Y-%m-%d'
 
 
@@ -86,8 +86,10 @@
         addWeekToOutput(output, currentWeek, previousDateKey)
 
     outputFilePath = wiki.replace(INPUT_DIR, OUTPUT_DIR)
-    # make sure the parent directories exist
-    path(outputFilePath).dirname().makedirs_p()
+    outputDirectory = os.path.dirname(outputFilePath)
+
+    if not os.path.exists(outputDirectory):
+        os.makedirs(outputDirectory)
 
     with open(outputFilePath, 'w') as o:
         writer = csv.writer(o, delimiter='\t')

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If6742289cc460169ed9cdf6be48969e292a7ce1d
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-edit-data
Gerrit-Branch: master
Gerrit-Owner: Milimetric <dandree...@wikimedia.org>

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

Reply via email to