mirror of
https://github.com/Findus23/PaperLibrary-cli.git
synced 2024-09-20 17:03:46 +02:00
make bibliography read-only
This commit is contained in:
parent
53c60a22b5
commit
bf755f55c7
1 changed files with 3 additions and 0 deletions
|
@ -3,6 +3,7 @@ import os
|
||||||
import shutil
|
import shutil
|
||||||
from datetime import datetime, timezone
|
from datetime import datetime, timezone
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from stat import S_IREAD, S_IRGRP, S_IROTH, S_IWUSR
|
||||||
|
|
||||||
from alive_progress import alive_bar
|
from alive_progress import alive_bar
|
||||||
from tzlocal import get_localzone
|
from tzlocal import get_localzone
|
||||||
|
@ -179,5 +180,7 @@ def update_notes(api: PaperLibraryAPI, config: Config):
|
||||||
def write_bibliography(api: PaperLibraryAPI, config: Config):
|
def write_bibliography(api: PaperLibraryAPI, config: Config):
|
||||||
bib = api.fetch_bibliography()
|
bib = api.fetch_bibliography()
|
||||||
target_file = config.basedir_path / "bibliography.bib"
|
target_file = config.basedir_path / "bibliography.bib"
|
||||||
|
target_file.chmod(S_IWUSR | S_IREAD)
|
||||||
with target_file.open("w") as f:
|
with target_file.open("w") as f:
|
||||||
f.write(bib)
|
f.write(bib)
|
||||||
|
target_file.chmod(S_IREAD | S_IRGRP | S_IROTH)
|
||||||
|
|
Loading…
Reference in a new issue