Permalink
Browse files

Fixed import error and indentation error

  • Loading branch information...
1 parent 5fda320 commit 706ed9cda2d9e38a9ad4767e04089140c67d6e62 Silver Stripe Software committed Dec 3, 2009
Showing with 22 additions and 22 deletions.
  1. +22 −22 createBadges.py
View
@@ -24,7 +24,7 @@
# siddharta at silverstripesoftware dot com
#
-import Image, ImageDraw, ImageFont
+from PIL import Image, ImageDraw, ImageFont
from csvimport import CsvReader
class BadgeImage(object):
@@ -93,27 +93,27 @@ def __init__(self, filename):
fp.close()
def getData(self):
- reader = CsvReader(self.content)
- reader.setColumnAlias(0, "fname")
- reader.setColumnAlias(1, "lname")
- reader.setColumnAlias(2, "company")
- reader.setColumnAlias(3, "id")
- for row in reader.rows():
- name = row.fname + " " + row.lname
- company = row.company
- id = row.id
- name = name.title()
- # For company names that start with * we dont convert
- # to title case. This is helpful for acronym names.
- # Eg: IBM should not become Ibm, so we mark it as *IBM
- # in the file
- if not company.startswith("*"):
- company = company.title()
- else:
- # If name starts with * then remove the star and
- # take the rest as the company name
- company = company[1:]
- yield (id, name.title(), company)
+ reader = CsvReader(self.content)
+ reader.setColumnAlias(0, "fname")
+ reader.setColumnAlias(1, "lname")
+ reader.setColumnAlias(2, "company")
+ reader.setColumnAlias(3, "id")
+ for row in reader.rows():
+ name = row.fname + " " + row.lname
+ company = row.company
+ id = row.id
+ name = name.title()
+ # For company names that start with * we dont convert
+ # to title case. This is helpful for acronym names.
+ # Eg: IBM should not become Ibm, so we mark it as *IBM
+ # in the file
+ if not company.startswith("*"):
+ company = company.title()
+ else:
+ # If name starts with * then remove the star and
+ # take the rest as the company name
+ company = company[1:]
+ yield (id, name.title(), company)
import sys

0 comments on commit 706ed9c

Please sign in to comment.