ecen224/
+notes/
+homework/
+research papers/
+projects/
Previously, with smug, I'd have to share the entire repo. The root
directory of the repo is basically grafted onto a location on my
website with a urlconf that might look like this:
(r'^school/ecen224/', include('smug.urls'), {'repo': 'ecen224',})
If I want to share my notes only, but not my homework or anything else,
I can now do the following:
(r'^school/ecen224/', include('smug.urls'), {'repo': 'ecen224',
'prefix': 'notes/'}),
This is effectively grafting a single subdirectory to my web page. I can
even define multiple url patterns with different prefixes on the same
repository.
So, anyway here's the patch. I'm planning on adding all the info in this
message to the documentation, but the documentation is a bit behind at
the moment.
Thanks!
Jeff Anderson
I think it's a great feature to have. I took some liberties with the
patch because I was uncomfortable with having load.py have to worry
about the prefix. I just created a branch called "prefix" where I
commited your changes with my modifications. Do you see any drawbacks
to the changed version? I wouldn't be surprised if you had a reason
that I didn't see.
Thanks for sending in your improvements.
--
Andrew McNabb
http://www.mcnabbs.org/andrew/
PGP Fingerprint: 8A17 B57C 6879 1863 DE55 8012 AB4D 6098 8826 6868
Your version of the patch looks wonderful.
The only reason I passed around the prefix everywhere instead of
calculating it at the first chance was in case it caused an unforeseen
interaction with the lower level code later on. Being able to tell if a
path is prefixed or not would make debugging similar *if* it ever causes
a problem, but not impossible.
With that said, your version is cleaner, and I like it better.
Thanks!
Jeff Anderson
Why, thank you. :)
Would you mind giving it a test? If all goes well, I'll go ahead and
merge it into the master branch.
It seems to work just as well. I just checked yours out, and nothing
broke. I did all the same tests that I did when I wrote the first patch,
so any bugs that are in yours are in mine too.
Jeff Anderson
I'll merge this in later today, then. Thanks.
This brings up a good question - should we start looking at adding a
unit/doc test suite to smug?
--
Jonathan Wilson
I think that's a great idea. We already have some doctests in gitlib,
but we don't have any on the Django side. The main reason that this
hasn't happened yet is that I don't have much experience writing unit
tests for web apps. It's definitely a good idea.