File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66from .group import Group
77from .journal import Journal
88from .user import User
9- from .settings import REQUESTS_TIMEOUT
9+ from .settings import BUGOUT_BROOD_URL , BUGOUT_SPIRE_URL , REQUESTS_TIMEOUT
1010
1111
1212class InvalidParameters (ValueError ):
@@ -17,7 +17,9 @@ class InvalidParameters(ValueError):
1717
1818class Bugout :
1919 def __init__ (
20- self , brood_api_url : Optional [str ] = None , spire_api_url : Optional [str ] = None
20+ self ,
21+ brood_api_url : str = BUGOUT_BROOD_URL ,
22+ spire_api_url : str = BUGOUT_SPIRE_URL ,
2123 ) -> None :
2224 self .brood_api_url = brood_api_url
2325 self .spire_api_url = spire_api_url
@@ -35,13 +37,9 @@ def spire_url(self):
3537 return self .spire_api_url
3638
3739 def brood_ping (self ) -> Dict [str , str ]:
38- if self .brood_api_url is None :
39- raise InvalidParameters ("Brood API url should be provided" )
4040 return ping (self .brood_api_url )
4141
4242 def spire_ping (self ) -> Dict [str , str ]:
43- if self .spire_api_url is None :
44- raise InvalidParameters ("Spire API url should be provided" )
4543 return ping (self .spire_api_url )
4644
4745 # User handlers
Original file line number Diff line number Diff line change 11import os
22
3+ BUGOUT_BROOD_URL = "https://auth.bugout.dev"
4+ BUGOUT_SPIRE_URL = "https://spire.bugout.dev"
5+
36REQUESTS_TIMEOUT = 5
47REQUESTS_TIMEOUT_RAW = os .environ .get ("BUGOUT_TIMEOUT_SECONDS" )
58try :
You can’t perform that action at this time.
0 commit comments