more cleanup
This commit is contained in:
@ -22,7 +22,6 @@ class AuthMixin(ABC):
|
|||||||
tn = typename(self)
|
tn = typename(self)
|
||||||
return f"{tn} @ {self.address}"
|
return f"{tn} @ {self.address}"
|
||||||
|
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def authenticate(self, username, password):
|
def authenticate(self, username, password):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
@ -60,7 +60,7 @@ class HttpClient(AuthMixin):
|
|||||||
def make_filter(where:dict=None, limit:int=0, skip:int=0, fields:dict=None, include:dict=None, order:list=None):
|
def make_filter(where:dict=None, limit:int=0, skip:int=0, fields:dict=None, include:dict=None, order:list=None):
|
||||||
filt = dict()
|
filt = dict()
|
||||||
if where is not None:
|
if where is not None:
|
||||||
items = [{k: v} for k, v in where.items()]
|
items = [where.copy()]
|
||||||
filt["where"] = {"and": items}
|
filt["where"] = {"and": items}
|
||||||
if limit > 0:
|
if limit > 0:
|
||||||
filt["limit"] = limit
|
filt["limit"] = limit
|
||||||
|
@ -18,7 +18,6 @@ class SciCat(AuthMixin):
|
|||||||
else:
|
else:
|
||||||
return token
|
return token
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def proposals(self):
|
def proposals(self):
|
||||||
url = self.address + "/proposals"
|
url = self.address + "/proposals"
|
||||||
|
@ -29,10 +29,10 @@ def property_maker(name, type_name):
|
|||||||
return prop
|
return prop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Snippet:
|
class Snippet:
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
super().__init__()
|
|
||||||
self._properties = []
|
self._properties = []
|
||||||
self.set_properties(**kwargs)
|
self.set_properties(**kwargs)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user