From 4206554950319307b4f01bf0e38ef3e44e8ae30d Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Thu, 22 Dec 2022 17:43:06 +0100 Subject: [PATCH] initial commit --- .gitignore | 206 +++++++++++++++++++ extract/__init__.py | 0 extract/__pycache__/__init__.cpython-310.pyc | Bin 0 -> 224 bytes extract/__pycache__/extract.cpython-310.pyc | Bin 0 -> 4448 bytes extract/extract.py | 148 +++++++++++++ 5 files changed, 354 insertions(+) create mode 100644 .gitignore create mode 100644 extract/__init__.py create mode 100644 extract/__pycache__/__init__.cpython-310.pyc create mode 100644 extract/__pycache__/extract.cpython-310.pyc create mode 100644 extract/extract.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b015b65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,206 @@ +# Created by https://www.toptal.com/developers/gitignore/api/python,linux,vim +# Edit at https://www.toptal.com/developers/gitignore?templates=python,linux,vim + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Python ### +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + +### Python Patch ### +# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration +poetry.toml + + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +!*.svg # comment out if you don't need vector files +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim +Sessionx.vim + +# Temporary +.netrwhist +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + +# End of https://www.toptal.com/developers/gitignore/api/python,linux,vim diff --git a/extract/__init__.py b/extract/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/extract/__pycache__/__init__.cpython-310.pyc b/extract/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f822506969330a94909ab1843c00226f19175dfa GIT binary patch literal 224 zcmYk0u?oU45QbCfAc7C#(4OKd;^gR3_mZZe4W>y*E~RnxO~l1la`i2oOhwQi?mPY; z?&tJ;J|j_Abz|dxj`&v+%`T2hBWhBRMRK?kJH|h}F3{?ZLq{zJ$QflV2NR6uXan@Z zqNkFp-T_rgBOlOGhC-{XulDETP{_=Lb-r4H6jeOLR;!P70(oXAJJE(aFusbAzH#ua afU*=yU|HrSJf@pY*Ix4N_?(+Wq~r~SyFO+B literal 0 HcmV?d00001 diff --git a/extract/__pycache__/extract.cpython-310.pyc b/extract/__pycache__/extract.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7b308c01134b01cdeae4aebdac0439429e2f8b6d GIT binary patch literal 4448 zcmai1TW{RP73T1^Txun)WyN-y*kRKY>86nsC%w9E5XZ8M6p5ND4verdXliF9QRb5C z8Ln+DRzVO4MPH2kfWW{C=tJ|D=Cx1x2StLw{myV#(kcbIiy}5X<*NR(a?&tHpg?PcxjeN1!j@yO~@-w}qc!^nmvUrn+Us^mA z&BsoBR?Ll;4=p~&TVGm_S^S)6nfW|lF!OVqePneOzlF5cM#s_ade*J9`+lY>?cEym zbMdW%M;)eHAEtdF)ra|DCo4L(Zkze_-L%*dHy((h!b+*C>t(N(7Tm1hEmw+uiE&v9 zRpt*w(#3m7ctK9Ha~;0#h3V5jPrb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owe=nQ+t9ufbprWo z2p9)b-->`X^m`|hWEv(%^QxQ5B={Z1Kg1%iuunWxo-2UEv7Cv)>_J7=9cyTt8opR_IGf?h6 z@{gOCjM&&R>VEN4`@m#x8C8g5U*i@*nHz=(58Mj1SslBcI<$WO3|4B&HB}cPlJj=- z@^|cIxsF{aO&e6nUh9-CYpXQMGw!>P?ErPXVgO_E#4OgkzT*5P|YWCgz$o zlK@YGicSqsbxwlHXu{u+xKUU`XSK&QdpK9h!maZ#4}m;?6%yg+)Lo*EsuYuHP4<=)2Thoe zgkec0lpj-fY+FN7y(6gvr7&Xxe*mDnO@vN6m<#4j^8-IycQ{*RErjQj)G>Yd{w>PRCxMCF^*vQoWK?`=zp1)cK-E80=}O1_E(?N|H# ztk{txfOM!MRhZxDo7vDoGJok}nt!t#35mpvrP(N;4f&z?xilsOT|T*FIg~ u0aH4i5#xkbj>QhH)~I=#jG_n^ffbk}7 \"{annot}\"") + print("") + + + def to_notes(self, filename, annotations): + with open(f"{os.path.splitext(filename)[0]}.md", "w") as out: + out.write(f"# Annotations:\n\n") + out.writelines(annotations) + out.write(f"\n---") + + +@PaperChangeEvent.listen() +def paper_change_event(event): + """When a paper is changed, commit the changes to the directory.""" + pass + # if ExtractPlugin.is_loaded(): + # git = ExtractPlugin.get_instance() + # if not git.manual: + # event_desc = event.description + # for a, b in [('\\', '\\\\'), ('"', '\\"'), ('$', '\\$'), ('`', '\\`')]: + # event_desc = event_desc.replace(a, b) + # git.list_of_changes.append(event_desc) + + +@PostCommandEvent.listen() +def git_commit(event): + pass + # if ExtractPlugin.is_loaded(): + # try: + # extract = ExtractPlugin.get_instance() + # if len(extract.list_of_changes) > 0: + # if not extract.manual: + # title = ' '.join(sys.argv) + '\n' + # message = '\n'.join([title] + extract.list_of_changes) + # + # extract.shell('add .') + # extract.shell('commit -F-', message.encode('utf-8')) + # except RuntimeError as exc: + # uis.get_ui().warning(exc.args[0])