~facundo/enjuewemela/trunk

« back to all changes in this revision

Viewing changes to enjuewemela/gems.py

  • Committer: facundo at com
  • Date: 2012-11-05 12:14:34 UTC
  • mto: (92.1.15 trunk)
  • mto: This revision was merged to the branch mainline in revision 94.
  • Revision ID: facundo@taniquetil.com.ar-20121105121434-8pdaoelvcu9tq5zp
CodeĀ aesthetics.

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
 
92
92
    def __init__(self):
93
93
        # load all the gems
94
 
        jewels = os.listdir(os.path.join(config.BASEDIR, "jewels"))
95
 
        self.pngs = sorted(x for x in jewels
96
 
                           if x.endswith('.png') and not x.startswith('expl')
97
 
                                                 and not x.startswith('crazy'))
 
94
        jewels_path = os.path.join(config.BASEDIR, "jewels")
 
95
        jewels = [x for x in os.listdir(jewels_path)
 
96
                  if not x.startswith('expl') and not x.startswith('crazy')]
 
97
        self.pngs = sorted(x for x in jewels if x.endswith('.png'))
98
98
        if len(self.pngs) != 7:
99
99
            raise ValueError("The gems (png files) in the 'gems' directory "
100
100
                             "must be 7! (found %d)" % len(self.pngs))