Comments (1)
- with the globally managed model classes, one Course can exist within multiple Semesters, so some invariants the VirtualPath relies on no longer hold
- as _known_tokens uses the most specific known data, the path of a child VirtualPath may change in comparison to its parent (due to the above point and more specific values for children, e.g. creation time)
- path / known_data validation should be reenabled in VirtualPath, once changing known_data is fixed. InvalidVirtualPathException should be thrown and handled gracefully
Old checks that assume that one Course can only exist within one Semester:
if self._course:
assert not self._semester or self._course.semester == self._semester, \
"virtual path %s describes course %s of semester %s, " \
"which doesn't match the semester of the virtual path %s" % \
(self, self._course, self._course.semester, self._semester)
if self._file:
assert not self._semester or self._file.semester == self._semester, \
"virtual path %s describes file %s of semester %s, " \
"which doesn't match the semester of the virtual path %s" % \
(self, self._file, self._file.semester, self._semester)
assert not self._course or self._file.course == self._course, \
"virtual path %s describes file %s of course %s %s, " \
"which doesn't match the course of the virtual path %s %s" % \
(self, self._file, self._file.course, self._file.course.semester, self._course, self._course.semester)
New checks that ensure that known_data doesn't change:
if self.parent:
assert self.partial_path.startswith(self.parent.partial_path), \
"Path of child file %s doesn't start with the path of its parent %s. " \
"Does your path format specification make sense?" % (self, self.parent)
assert set(self._known_tokens.items()).issuperset(self.parent._known_tokens.items()), \
"Known data of child file %s doesn't include all data of its parent %s. " \
"Does your path format specification make sense? " \
"Offending keys are:\n%s" % (self, self.parent, tabulate(
((key, self.parent._known_tokens.get(key, "unset"), self._known_tokens.get(key, "unset"))
for key in set(chain(self._known_tokens.keys(), self.parent._known_tokens.keys()))),
headers=["key", "parent value", "child value"], missingval="None"
))
from studip-fuse.
Related Issues (13)
- Improved caching for offline operation HOT 2
- studip-fuse fails to start: No module named 'studip_fuse.launcher.aioimpl' HOT 8
- List of path format placeholders is outdated HOT 1
- 'ascii' codec can't encode character '\xe4' in 'Universit\xe4t Passau' on Python 3.5.3 HOT 2
- Python 3.5.3 compatibility HOT 5
- Doesn't create missing config directory
- Can't install on ArchLinux: No matching distribution found for setuptools-meta HOT 2
- studip-fuse at Leibniz-Universität Hannover HOT 1
- Low-level fuse driver improvements HOT 2
- Run command when mount becomes available HOT 2
- Reading password from file broken HOT 1
- Allow mounting from fstab with `user` option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from studip-fuse.