Skip to content

Commit 46d9ad1

Browse files
committed
fix line formatting
1 parent 3982462 commit 46d9ad1

File tree

1 file changed

+27
-14
lines changed

1 file changed

+27
-14
lines changed

pylnbits/user_manager.py

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"""
2222

2323
###################################
24-
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
24+
logging.basicConfig(level=logging.INFO,
25+
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s")
2526
logging.getLogger("pylnbits").setLevel(level=logging.WARNING)
2627
logger = logging.getLogger(__name__)
2728
###################################
@@ -30,7 +31,7 @@
3031
class UserManager:
3132
def __init__(self, config, session: ClientSession = None):
3233
"""__init__
33-
34+
3435
Initializes a UserManager extension via API
3536

3637
"""
@@ -50,7 +51,8 @@ async def get_users(self):
5051
try:
5152
upath = "/usermanager/api/v1/users"
5253
path = self._lnbits_url + upath
53-
res = await get_url(session=self._session, path=path, headers=self._invoice_headers)
54+
res = await get_url(session=self._session, path=path,
55+
headers=self._invoice_headers)
5456
return res
5557
except Exception as e:
5658
logger.info(e)
@@ -66,7 +68,8 @@ async def get_user(self, user_id):
6668
try:
6769
upath = "/usermanager/api/v1/users/" + user_id
6870
path = self._lnbits_url + upath
69-
res = await get_url(session=self._session, path=path, headers=self._invoice_headers)
71+
res = await get_url(session=self._session,
72+
path=path, headers=self._invoice_headers)
7073
return res
7174
except Exception as e:
7275
logger.info(e)
@@ -82,7 +85,8 @@ async def get_wallets(self, user_id):
8285
try:
8386
wpath = "/usermanager/api/v1/wallets/" + user_id
8487
path = self._lnbits_url + wpath
85-
res = await get_url(session=self._session, path=path, headers=self._invoice_headers)
88+
res = await get_url(session=self._session, path=path,
89+
headers=self._invoice_headers)
8690
return res
8791
except Exception as e:
8892
logger.info(e)
@@ -98,7 +102,8 @@ async def get_tx(self, wallet_id):
98102
try:
99103
tpath = "/usermanager/api/v1/wallets" + wallet_id
100104
path = self._lnbits_url + tpath
101-
res = await get_url(session=self._session, path=path, headers=self._invoice_headers)
105+
res = await get_url(session=self._session, path=path,
106+
headers=self._invoice_headers)
102107
return res
103108
except Exception as e:
104109
logger.info(e)
@@ -111,9 +116,11 @@ async def post_user_initial(self, admin_id, user_name, wallet_name):
111116
try:
112117
tpath = "/usermanager/api/v1/users"
113118
path = self._lnbits_url + tpath
114-
body = {"admin_id": admin_id, "user_name": user_name, "wallet_name": wallet_name}
119+
body = {"admin_id": admin_id, "user_name": user_name,
120+
"wallet_name": wallet_name}
115121
jbody = json.dumps(body)
116-
res = await post_url(session=self._session, path=path, headers=self._invoice_headers, body=jbody)
122+
res = await post_url(session=self._session, path=path,
123+
headers=self._invoice_headers, body=jbody)
117124
return res
118125
except Exception as e:
119126
logger.info(e)
@@ -127,14 +134,17 @@ async def post_wallet(self, user_id, wallet_name, admin_id):
127134
"""
128135
Post_wallet returns api keys related to wallet
129136

130-
Returns {"id": <string>, "admin": <string>, "name": <string>, "user": <string>, "adminkey": <string>, "inkey": <string>}
137+
Returns {"id": <string>, "admin": <string>, "name": <string>,
138+
"user": <string>, "adminkey": <string>, "inkey": <string>}
131139
"""
132140
try:
133141
tpath = "/usermanager/api/v1/wallets"
134142
path = self._lnbits_url + tpath
135-
body = {"user_id": user_id, "wallet_name": wallet_name, "admin_id": admin_id}
143+
body = {"user_id": user_id, "wallet_name": wallet_name,
144+
"admin_id": admin_id}
136145
jbody = json.dumps(body)
137-
res = await post_url(session=self._session, path=path, headers=self._invoice_headers, body=jbody)
146+
res = await post_url(session=self._session,
147+
path=path, headers=self._invoice_headers, body=jbody)
138148
return res
139149
except Exception as e:
140150
logger.info(e)
@@ -147,7 +157,8 @@ async def delete_user(self, user_id):
147157
try:
148158
tpath = "/usermanager/api/v1/users/" + user_id
149159
path = self._lnbits_url + tpath
150-
res = await delete_url(session=self._session, path=path, headers=self._invoice_headers)
160+
res = await delete_url(session=self._session,
161+
path=path, headers=self._invoice_headers)
151162
return res
152163
except Exception as e:
153164
logger.info(e)
@@ -160,7 +171,8 @@ async def delete_wallet(self, wallet_id):
160171
try:
161172
tpath = "/usermanager/api/v1/wallets/" + wallet_id
162173
path = self._lnbits_url + tpath
163-
res = await delete_url(session=self._session, path=path, headers=self._invoice_headers)
174+
res = await delete_url(session=self._session,
175+
path=path, headers=self._invoice_headers)
164176
return res
165177
except Exception as e:
166178
logger.info(e)
@@ -178,7 +190,8 @@ async def post_activate_ext(self, user_id: str, extension: str, active: int):
178190
path = self._lnbits_url + tpath
179191
body = {"userid": user_id, "extension": extension, "active": active}
180192
jbody = json.dumps(body)
181-
res = await post_url(session=self._session, path=path, headers=self._invoice_headers, body=jbody)
193+
res = await post_url(session=self._session, path=path,
194+
headers=self._invoice_headers, body=jbody)
182195
return res
183196
except Exception as e:
184197
logger.info(e)

0 commit comments

Comments
 (0)