Yuji Hanamura avatar Yuji Hanamura committed b06c226

Rename variable and function.

Comments (0)

Files changed (1)

         week_db = {}
         for x in range(0, (stop_day - start_day).days):
-            day = start_day + datetime.timedelta(days=x)
-            week_num = day.isocalendar()[1]
+            date = start_day + datetime.timedelta(days=x)
+            week_num = date.isocalendar()[1]
             if week_num not in week_db:
                 week_db[week_num] = []
-            week_db[week_num].append(day)
+            week_db[week_num].append(date)
         return week_db
         return self.__week_db[x]
-def getweeknum(day=None):
+def get_week_num(date=None):
-    if not day:
-        day = datetime.date.today()
-    elif isinstance(day, (tuple, list)):
-        day = datetime.date(int(day[0]), int(day[1]), int(day[2]))
-    elif isinstance(day, dict):
-        day = datetime.date(int(day['year']), int(day['month']), int(day['day']))
-    elif not isinstance(day, datetime.date):
-        day = datetime.date(int(day.year), int(day.month), int(day.year))
+    if not date:
+        date = datetime.date.today()
+    elif isinstance(date, (tuple, list)):
+        date = datetime.date(int(date[0]), int(date[1]), int(date[2]))
+    elif isinstance(date, dict):
+        date = datetime.date(int(date['year']), int(date['month']), int(date['day']))
+    elif not isinstance(date, datetime.date):
+        date = datetime.date(int(date.year), int(date.month), int(date.year))
-    return day.isocalendar()[1]
+    return date.isocalendar()[1]
 if __name__ == '__main__':
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.