Fixing flake8 errors.
This commit is contained in:
parent
d35a35f6ad
commit
b0e8bb1307
@ -6,12 +6,11 @@ import logging
|
||||
|
||||
from typing import List, Optional, Dict, Union
|
||||
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
#
|
||||
# TODOs and FIXMEs
|
||||
#
|
||||
# * come up with a better way to specify `where` clauses.
|
||||
@ -75,7 +74,7 @@ class APIv4:
|
||||
"""
|
||||
self.session = requests.Session()
|
||||
|
||||
### Perform login post
|
||||
# Perform login post
|
||||
self.session.cookies.update({"has_js": "1"})
|
||||
postdata = {
|
||||
"name": user,
|
||||
@ -118,7 +117,7 @@ class APIv4:
|
||||
|
||||
url = self.api_url+'/'+objName+'/'+action
|
||||
if params:
|
||||
result = self.session.post(url, params={'params':json.dumps(params)}, data="")
|
||||
result = self.session.post(url, params={'params': json.dumps(params)}, data="")
|
||||
else:
|
||||
result = self.session.post(url, data="")
|
||||
if (not result.ok):
|
||||
@ -188,7 +187,11 @@ class APIv4:
|
||||
|
||||
return [x["name"] for x in ent]
|
||||
|
||||
def get(self, objName: str, where: Optional[List]=None, limit: Optional[int]=None, select=Optional[List[str]]) -> List:
|
||||
def get(self,
|
||||
objName: str,
|
||||
where: Optional[List] = None,
|
||||
limit: Optional[int] = None,
|
||||
select=Optional[List[str]]) -> List:
|
||||
"""
|
||||
Get objects based on a where clause, optional limit and optional field list.
|
||||
|
||||
@ -207,7 +210,7 @@ class APIv4:
|
||||
params["limit"] = limit
|
||||
if where is not None:
|
||||
params["where"] = where
|
||||
if columns is not None and columns:
|
||||
if select is not None and select:
|
||||
params["select"] = select
|
||||
|
||||
return self.call_values(objName, "get", params=params)
|
||||
|
@ -1,3 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["setuptools", "wheel"]
|
||||
build-backend = "setuptools-build_meta"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user