-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #2504 -- add nikola theme --list-installed #2512
Conversation
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
themes = [] | ||
themes_dirs = self.site.themes_dirs + [resource_filename('nikola', os.path.join('data', 'themes'))] | ||
for tdir in themes_dirs: | ||
themes += [(i, os.path.join(tdir, i)) for i in os.listdir(tdir)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you filter themes by isdir() just in case there is some random file in themes/ or similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 fixes the only propblem I saw there.
That's very helpful and so nice of you @Kwpolska and @ralsina for implementing this in such a short period of time. Another kind suggestion: can we do something about preventing a user from even attempting to install Even though it throws an error, it should have prevented me from attempting to do so by simply invalidating the theme name. nikola theme --install=bootstrap3
[2016-09-25T18:35:12Z] INFO: requests.packages.urllib3.connectionpool: Starting new HTTPS connection (1): themes.getnikola.com
[2016-09-25T18:35:18Z] ERROR: theme: Theme 'bootstrap3' is already installed in /home/stefanos/.virtualenvs/mynewenv/lib/python3.5/site-packages/nikola/data/themes/bootstrap3 |
The theme doesn’t get overwritten (in fact, you can’t download base and bootstrap3 from the site). We could check the built-in theme list if we really cared, but this is good enough IMO. |
That should do too, no worries. |
This is #2504.
cc @ralsina, @stefanos82.