11#!/usr/bin/env python3
22# -*- coding: utf-8 -*-
33
4- __author__ = ' ipetrash'
4+ __author__ = " ipetrash"
55
66
77import re
8- PATTERN_GET_JIRA = re .compile (r'\[.*?\] \((\w+?-\d+?)\)' )
8+
9+ import config
10+ import common
11+
12+
13+ PATTERN_GET_JIRA = re .compile (r"\[.*?\] \((\w+?-\d+?)\)" )
914
1015
1116def get_jira (msg ):
@@ -22,26 +27,21 @@ def get_jira(msg):
2227 return match .group (1 )
2328
2429
25- import config
26- import common
27-
2830log_list = common .get_log_list (config .SVN_FILE_NAME )
2931# OR:
3032# log_list = common.get_log_list(config.URL_SVN)
3133
32- print (' Total commits:' , len (log_list ))
34+ print (" Total commits:" , len (log_list ))
3335
3436
35- from collections import OrderedDict
36- month_by_jira_info = OrderedDict ()
37-
37+ month_by_jira_info = dict ()
3838
3939for log in reversed (log_list ):
4040 jira = get_jira (log .msg )
4141 if not jira :
4242 continue
4343
44- key = log .date .strftime (' %Y/%m' )
44+ key = log .date .strftime (" %Y/%m" )
4545
4646 if key not in month_by_jira_info :
4747 month_by_jira_info [key ] = set ()
@@ -50,7 +50,8 @@ def get_jira(msg):
5050
5151for month , jira_items in month_by_jira_info .items ():
5252 # Хитрая сортировка по двум параметрами: имя проекта и номер джиры
53- jira_items = sorted (jira_items , key = lambda x : ( x . split ( '-' )[ 0 ], int ( x . split ( '-' )[ 1 ])))
54-
55- print ( '{}: ({}) \t {}' . format ( month , len ( jira_items ), jira_items ) )
53+ jira_items = sorted (
54+ jira_items , key = lambda x : ( x . split ( "-" )[ 0 ], int ( x . split ( "-" )[ 1 ]))
55+ )
5656
57+ print ("{}: ({})\t {}" .format (month , len (jira_items ), jira_items ))
0 commit comments