Spaces:
Sleeping
Sleeping
Create ingest/generic_public_foia.py
Browse files
ingest/generic_public_foia.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import abc
|
| 2 |
import asyncio
|
| 3 |
from typing import List, Dict
|
| 4 |
-
from ingest.utils import
|
| 5 |
|
| 6 |
class GenericFOIAAdapter(abc.ABC):
|
| 7 |
source_name: str = "UNKNOWN"
|
|
@@ -20,7 +20,9 @@ class GenericFOIAAdapter(abc.ABC):
|
|
| 20 |
self._last_call = asyncio.get_event_loop().time()
|
| 21 |
|
| 22 |
def robots_allowed(self) -> bool:
|
| 23 |
-
|
|
|
|
|
|
|
| 24 |
|
| 25 |
@abc.abstractmethod
|
| 26 |
async def search(self, query: str) -> List[Dict]:
|
|
|
|
| 1 |
import abc
|
| 2 |
import asyncio
|
| 3 |
from typing import List, Dict
|
| 4 |
+
from ingest.utils import robots_allowed
|
| 5 |
|
| 6 |
class GenericFOIAAdapter(abc.ABC):
|
| 7 |
source_name: str = "UNKNOWN"
|
|
|
|
| 20 |
self._last_call = asyncio.get_event_loop().time()
|
| 21 |
|
| 22 |
def robots_allowed(self) -> bool:
|
| 23 |
+
if not self.base_url:
|
| 24 |
+
return False
|
| 25 |
+
return robots_allowed(self.base_url)
|
| 26 |
|
| 27 |
@abc.abstractmethod
|
| 28 |
async def search(self, query: str) -> List[Dict]:
|