refactor: removed redaktions-directus
This commit is contained in:
@@ -1,7 +1,4 @@
|
||||
import json
|
||||
|
||||
from git import Repo
|
||||
from tqdm import tqdm
|
||||
|
||||
from api.directus import DirectusAPI
|
||||
|
||||
@@ -13,29 +10,6 @@ class Download:
|
||||
self.config = config
|
||||
self.content_api = content_api
|
||||
|
||||
def download_snippets(self):
|
||||
snippets = {}
|
||||
for snippet in tqdm(self.content_api.get("items/snippet"), desc="Downloading snippets"):
|
||||
snippets[snippet["ident"]] = snippet["content"]
|
||||
with (self.config.p_data / "snippets.json").open("w", encoding="utf-8") as file:
|
||||
json.dump(snippets, file, ensure_ascii=False, indent=4)
|
||||
|
||||
def download_content(self):
|
||||
contents = []
|
||||
for content in self.content_api.get(
|
||||
"items/content"
|
||||
): # tqdm(self.content_api.get("items/content"), desc="Downloading content"):
|
||||
contents.append(
|
||||
{
|
||||
"url_part": content["url_part"],
|
||||
"content": content["content"],
|
||||
"sidebar": content["sidebar"],
|
||||
}
|
||||
)
|
||||
|
||||
with (self.config.p_data / "content.json").open("w", encoding="utf-8") as file:
|
||||
json.dump(contents, file, ensure_ascii=False, indent=4)
|
||||
|
||||
def download_git_content(self):
|
||||
repo_path = self.config.p_data / "git_content"
|
||||
if not repo_path.exists():
|
||||
|
||||
Reference in New Issue
Block a user