1 |
commit: a1969d4941ea056104a268b2cc1603272d825347 |
2 |
Author: Slava Bacherikov <slava <AT> bacher09 <DOT> org> |
3 |
AuthorDate: Mon Jul 30 12:19:39 2012 +0000 |
4 |
Commit: Slava Bacherikov <slava <AT> bacherikov <DOT> org <DOT> ua> |
5 |
CommitDate: Mon Jul 30 12:19:39 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-packages.git;a=commit;h=a1969d49 |
7 |
|
8 |
Add generate style command for generate css representation of pygments style |
9 |
|
10 |
--- |
11 |
.../packages/management/commands/generatestyle.py | 11 +++++++++++ |
12 |
.../generic_metadata/changelog_highlight.py | 4 ++++ |
13 |
2 files changed, 15 insertions(+), 0 deletions(-) |
14 |
|
15 |
diff --git a/gpackages/apps/packages/management/commands/generatestyle.py b/gpackages/apps/packages/management/commands/generatestyle.py |
16 |
new file mode 100644 |
17 |
index 0000000..4bd0f22 |
18 |
--- /dev/null |
19 |
+++ b/gpackages/apps/packages/management/commands/generatestyle.py |
20 |
@@ -0,0 +1,11 @@ |
21 |
+from django.core.management.base import BaseCommand, CommandError |
22 |
+from optparse import make_option |
23 |
+from package_info.generic_metadata import changelog_highlight |
24 |
+ |
25 |
+ |
26 |
+class Command(BaseCommand): |
27 |
+ |
28 |
+ args = '' |
29 |
+ help = 'Will show some stats for repos' |
30 |
+ def handle(self, *args, **options): |
31 |
+ self.stdout.write(changelog_highlight.changelog_style_css() + '\n') |
32 |
|
33 |
diff --git a/gpackages/libs/package_info/generic_metadata/changelog_highlight.py b/gpackages/libs/package_info/generic_metadata/changelog_highlight.py |
34 |
index 43f9586..61ea5e1 100644 |
35 |
--- a/gpackages/libs/package_info/generic_metadata/changelog_highlight.py |
36 |
+++ b/gpackages/libs/package_info/generic_metadata/changelog_highlight.py |
37 |
@@ -177,3 +177,7 @@ def changelog_highlight(text): |
38 |
def changelog_termial_highlight(text): |
39 |
return highlight(text, ChangelogLexer(), |
40 |
Terminal256Formatter(style = ChangelogStyle)) |
41 |
+ |
42 |
+def changelog_style_css(): |
43 |
+ f = ChangelogHtmlFormater(style = ChangelogStyle) |
44 |
+ return f.get_style_defs() |