Skip to content

Commit 8e84074

Browse files
committed
Refactoring. Using black code style
1 parent 82f761e commit 8e84074

3 files changed

Lines changed: 30 additions & 21 deletions

File tree

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
__author__ = 'ipetrash'
4+
__author__ = "ipetrash"
55

66

7+
import svn.local
78
import config
89

9-
import svn.local
10+
1011
repo = svn.local.LocalClient(config.SVN_FILE_NAME)
1112

1213
# OR:
@@ -15,11 +16,17 @@
1516

1617

1718
log_list = [log for log in repo.log_default()]
18-
print('Total commits:', len(log_list))
19+
print("Total commits:", len(log_list))
1920
print()
2021

21-
release_version_log_list = [log for log in log_list if log.msg and 'Release version' in log.msg]
22-
print('Release version log ({}):'.format(len(release_version_log_list)))
22+
release_version_log_list = [
23+
log for log in log_list if log.msg and "Release version" in log.msg
24+
]
25+
print("Release version log ({}):".format(len(release_version_log_list)))
2326

2427
for i, log in enumerate(release_version_log_list, 1):
25-
print(' {:6}. [rev {}] {} {:15} "{}"'.format(i, log.revision, log.date, log.author, log.msg))
28+
print(
29+
' {:6}. [rev {}] {} {:15} "{}"'.format(
30+
i, log.revision, log.date, log.author, log.msg
31+
)
32+
)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
__author__ = 'ipetrash'
4+
__author__ = "ipetrash"
55

66

7+
import svn.remote
78
import config
89

9-
import svn.remote
10+
1011
repo = svn.remote.RemoteClient(config.URL_SVN)
1112

1213
print(list(repo.log_default(revision_from=159807, limit=1)))
Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
__author__ = 'ipetrash'
4+
__author__ = "ipetrash"
55

66

77
import 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

1116
def 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-
2830
log_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

3939
for 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

5151
for 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

Comments
 (0)