scripts/create-allura-sitemap.py should omit deleted projects and should have commandline option for neighborhood(s) to exclude. chunked_find
can take a query param, so that should work. The query shouldn't need to be indexed (and a $nin is even fine) since chunked_find
uses the _id
index to go through all the records. (If you're up for it, investigate the first time chunked_find is called in which max_id is None and thus _id won't be in the query but is in the sort - will that perform poorly? need to have an initial max_id?)
Also, <lastmod>
shouldn't just use the current date all the time, it should use the project mod date.
Closed #547.
je/42cc_7199
You can exclude multiple neighborhoods like this:
$ paster script ../Allura/development.ini ../scripts/create-allura-sitemap.py -- -n Users Adobe
What is the callback function for? It's not very clear to me, so it should have a better name and/or comments to explain itself.
The help text for
-n
says "URL prefix of excluded neighborhood(s)" but it actually uses nbhd names for the query. That should be fixed up. I personally do prefer to use url prefixes, since those never change and you don't have to worry about escaping whitespace on the commandline (which may happen for a name with a space in it)Closed #555. Force-pushed
je/42cc_7199
We've switched from
optparse
toargparse
, so there's no need in that odd callback function anymore (it was needed, 'causeoprparse
can't handle multiple values for argument).Also, we've changed
-n
parameter to use url prefixes.