~flimm/epidermis/icon-theme-bugfix

« back to all changes in this revision

Viewing changes to epidermis/pigments/theme_preview.py

  • Committer: David D Lowe
  • Date: 2011-01-04 22:50:19 UTC
  • Revision ID: daviddlowe.flimm@gmail.com-20110104225019-uo31kb54cbxjt5vt
Tidy up code with better comments.
Deleted unused functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# Copyright 2009 David D Lowe
3
3
# released under the GPL v3
4
 
"""Script that is run to generate metacity, or gtk preview images
5
 
usage:
 
4
"""Script that is run to generate metacity, or gtk preview images.
 
5
 
 
6
Usage:
 
7
 
6
8
python theme_preview.py metacity /path/to/themename /path/out.png
 
9
 
7
10
or:
 
11
 
8
12
GTK2_RC_FILES=/path/to/themename/gtk-2.0/gtkrcfiles python theme_preview.py gtk /path/out.png [/path/to/icondir]
 
13
 
9
14
or:
 
15
 
10
16
python icons /path/to/themename
 
17
 
11
18
or:
 
19
 
12
20
GTK2_RC_FILES=/path/to/themename/gtk-2.0/gtkrcfiles python theme_preview.py multiple /path/out.png [metacity /path/to/themename [icons /path/to/themename]
13
21
  [wallpaper /path/to/wallpaper.png]
 
22
 
14
23
"""
15
24
 
16
25
import sys
138
147
    print "Done"
139
148
    sys.exit(0)
140
149
 
141
 
def icon_generate(themePath,  outImage=None):
142
 
    """returns Pixbuf if outImage is None
143
 
    if outImage is specified, sys.exit will be called after the image is saved"""
 
150
def icon_generate(themePath, outImage=None):
 
151
    """Return Pixbuf if outImage is None.
 
152
    If outImage is specified, sys.exit will be called after the image is saved4
144
153
    
 
154
    """    
145
155
    saved = False
146
156
    for sizefolder in ("scalable",  "64x64",  "48x48",  "32x32",  "24x24",  "22x22",  "16x16",  "12x12","8x8"):
147
157
        if themePath is None: break