Skip to content

Commit f867629

Browse files
committed
Fixed all in __init__ and code refactor
1 parent c0463db commit f867629

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

codeforces_api/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Importing classes from modules
33
"""
4-
__all__ = ["CodeforcesApi"]
4+
__all__ = ["CodeforcesApi", "CodeforcesApiRequestMaker"]
55
from codeforces_api.api_requests import CodeforcesApi
66
from codeforces_api.api_request_maker import CodeforcesApiRequestMaker

codeforces_api/api_request_maker.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
21
import random
32
import time
43
import hashlib
54
import collections
65

7-
class CodeforcesApiRequestMaker():
6+
7+
class CodeforcesApiRequestMaker:
88

99
api_key = ""
1010
secret = ""
@@ -18,13 +18,13 @@ def __init__(self, api_key=None, secret=None, random_number=1000000):
1818
and 1000000 unless specified)
1919
"""
2020

21-
if random_number == 1000000 :
21+
if random_number == 1000000:
2222
random_number = random.randint(100000, 999999)
2323
self.assigned_rand = True
2424
elif random_number < 100000 and random_number > 999999:
2525
raise Exception(
2626
"Non 6-digit number passed as random_number for API Signature",
27-
random_number
27+
random_number,
2828
)
2929
if api_key is None and secret is None:
3030
self.anonimus = True
@@ -41,7 +41,7 @@ def generate_url(self, method_name, **fields):
4141

4242
if not self.anonimus:
4343

44-
#Renew Rand
44+
# Renew Rand
4545
if not self.assigned_rand:
4646
self.renew_rand()
4747

@@ -104,12 +104,12 @@ def renew_rand(self, random_number=1000000):
104104
It's recommended that you renew your apiSig for each request
105105
default is between 100000 and 1000000 unless specified)
106106
"""
107-
if random_number == 1000000 :
107+
if random_number == 1000000:
108108
random_number = random.randint(100000, 999999)
109109
elif random_number < 100000 and random_number > 999999:
110110
raise Exception(
111111
"Non 6-digit number passed as random_number for renew_rand",
112-
random_number
112+
random_number,
113113
)
114114

115115
def get_response(self, request):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="CodeforcesApiPy",
8-
version="1.1.1",
8+
version="1.1.2",
99
description="Implementation of codeforces.com API",
1010
platforms="any",
1111
url="https://github.com/VadVergasov/CodeforcesApiPy",

0 commit comments

Comments
 (0)