2020-10-14 21:38:36 +02:00
|
|
|
import click
|
|
|
|
|
|
|
|
from paperlibrary.api import PaperLibraryAPI
|
|
|
|
from paperlibrary.config import url, auth_token
|
|
|
|
from paperlibrary.library import write_symlinks, update_pdfs
|
|
|
|
|
|
|
|
|
|
|
|
@click.group()
|
|
|
|
def cli():
|
|
|
|
pass
|
|
|
|
|
2020-11-01 13:48:40 +01:00
|
|
|
|
2020-10-14 21:38:36 +02:00
|
|
|
@cli.command()
|
|
|
|
def update():
|
2020-11-01 13:48:40 +01:00
|
|
|
api = PaperLibraryAPI(url, auth_token=auth_token)
|
2020-10-14 21:38:36 +02:00
|
|
|
write_symlinks(api)
|
|
|
|
update_pdfs(api)
|
|
|
|
|
|
|
|
|
2020-11-01 13:48:40 +01:00
|
|
|
@cli.command()
|
|
|
|
def test():
|
|
|
|
api = PaperLibraryAPI(url, auth_token=auth_token)
|
|
|
|
|
|
|
|
print(api.fetch_papers())
|
|
|
|
|
|
|
|
|
2020-10-14 21:38:36 +02:00
|
|
|
if __name__ == '__main__':
|
|
|
|
cli()
|