Skip to content
Snippets Groups Projects
Commit a6f84c4c authored by tuhe's avatar tuhe
Browse files

Begin removing of snipper dependency

parent af77abcf
No related branches found
No related tags found
No related merge requests found
# 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
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__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/
\ No newline at end of file
......@@ -11,7 +11,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
# beamer-slider
setuptools.setup(
name="coursebox",
version="0.1.1",
version="0.1.2",
author="Tue Herlau",
author_email="tuhe@dtu.dk",
description="A course management system currently used at DTU",
......@@ -30,5 +30,5 @@ setuptools.setup(
package_dir={"": "src"},
packages=setuptools.find_packages(where="src"),
python_requires=">=3.8",
install_requires=['openpyxl', 'tika','xlwings','pybtex','langdetect','wexpect','pexpect','matplotlib','numpy','pycode_similar','jinjafy','beamer-slider','tinydb'],
install_requires=['numpy','pycode_similar','tika','openpyxl', 'xlwings','matplotlib','langdetect','jinjafy','beamer-slider','tinydb'],
)
No preview for this file type
......@@ -76,13 +76,6 @@ def get_enrolled_students():
students2[id] = s2
return students2
# def get_file_dir_or_template(filepath, templatepath):
# dn = os.path.dirname(filepath)
#
# thtools.ensure_dir_exists( )
# if not os.path.exists(os.path.dirname):
# shutil.copyfile(templatepath, filepath)
def get_instructors():
paths = get_paths()
instructors = xlsx_to_dicts(paths['information.xlsx'], sheet='instructors')
......@@ -133,6 +126,7 @@ def lectures(info, pensum=None):
r.append( {'url': url, 'shorturl': shorturl, 'description': description})
lecture["resources"] = r
if pensum is not None:
rd, html = lecture['reading'], ""
while True:
i = rd.find("\\cite")
......@@ -199,8 +193,6 @@ def get_forum(paths):
k = k.split(" ")[0]
for v in a[kk]:
dd[k.lower()].append(v.split(",")[i])
# list_dict2dict_list()
# dd = dict_(dd)
n = len(list(dd.values())[0])
d2 = []
......@@ -251,19 +243,41 @@ def class_information():
del gi['key']
del gi['value']
from snipper.load_citations import get_references
from snipper.load_citations import get_bibtex, get_aux
if "pensum_bib" in gi:
refs, nrefs = get_references(paths['02450public'] + "/" + gi['pensum_bib'], gi)
d['references'], d['new_references'] = refs, nrefs
bibtex = get_bibtex(paths['02450public'] + "/" + gi['pensum_bib'])
# refs, nrefs = get_references(paths['02450public'] + "/" + gi['pensum_bib'], gi)
# d['references'], d['new_references'] = refs, nrefs
cmds = []
ls = lambda x: x if isinstance(x, list) else [x]
if 'tex_command' in gi:
for cmd, aux, display in zip(ls(gi['tex_command']), ls(gi['tex_aux']), ls(gi['tex_display'])):
cm = dict(command=cmd, aux=get_aux(paths['02450public'] + "/"+aux), output=display)
cmds.append(cm)
# ax = parse_aux(aux, bibtex=gi['bibtex'])
# for k in ax:
# ax[k]['pyref'] = display % (ax[k]['nicelabel'],)
# newref[cmd] = ax
d['references'] = dict(bibtex=bibtex, commands=cmds)
# references = dict(bibtex=bibtex,
# # aux=auxfile,
# commands=[dict(command='\\aref2', output="(Assignment 2, %s)", aux=auxfile),
# dict(command='\\nref', output="\cite[%s]{herlau}", aux=auxfile),
# ])
else:
d['references'], d['new_references'] = None, None
print("[info]", "No bibtex rereferences specified. Check configuration file. ")
d['references'] = dict(commands=[], bibtex={}) #['bibtex'] = None
d.update(gi)
# set first day of class if CE
if continuing_education_mode:
ice = xlsx_to_dicts(paths['information.xlsx'], sheet='ce', as_dict_list=True)
d.update(ice)
d['lectures'], d['references'] = lectures(info=d, pensum=d['references'])
d['lectures'], d['references']['bibtex'] = lectures(info=d, pensum=d['references']['bibtex'])
d['first_day_of_class'] = first_day_of_class(info=d)
d['day_of_week_str'] = d['first_day_of_class'].strftime('%A')
......
No preview for this file type
No preview for this file type
No preview for this file type
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment