mirror of
https://github.com/Garmelon/PFERD.git
synced 2026-04-12 15:35:05 +02:00
Add file organizer
This commit is contained in:
parent
4e6912591c
commit
282d0252eb
4 changed files with 129 additions and 6 deletions
21
test.py
21
test.py
|
|
@ -1,6 +1,7 @@
|
|||
import PFERD
|
||||
import asyncio
|
||||
import logging
|
||||
import pathlib
|
||||
import os
|
||||
import sys
|
||||
|
||||
|
|
@ -8,13 +9,23 @@ logging.basicConfig(level=logging.DEBUG, format=PFERD.LOG_FORMAT)
|
|||
#logging.basicConfig(level=logging.INFO, format=PFERD.LOG_FORMAT)
|
||||
|
||||
async def test_download():
|
||||
base_path = pathlib.Path(".")
|
||||
sync_path = pathlib.Path(base_path, "synctest")
|
||||
|
||||
orga = PFERD.Organizer(base_path, sync_path)
|
||||
auth = PFERD.ShibbolethAuthenticator(cookie_path="cookie_jar")
|
||||
soup = await auth.get_webpage("885157")
|
||||
#soup = await auth.get_webpage("885157")
|
||||
|
||||
orga.clean_temp_dir()
|
||||
|
||||
filename = orga.temp_file()
|
||||
print(filename)
|
||||
await auth.download_file("file_886544_download", filename)
|
||||
orga.add_file(filename, pathlib.Path("test.pdf"))
|
||||
|
||||
orga.clean_sync_dir()
|
||||
orga.clean_temp_dir()
|
||||
await auth.close()
|
||||
if soup:
|
||||
print("Soup acquired!")
|
||||
else:
|
||||
print("No soup acquired :(")
|
||||
|
||||
def main():
|
||||
#print(f" os.getcwd(): {os.getcwd()}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue