fix issue recent refactoring got rid of the issue
I'm sad I don't know exactly what fixed it. But the code looks reasonably straightforward and does not crash anymore. Likely the spaghetti code we had before major refactoring was causing namespace pollution. Now it is clean and now it is great! :-D
@@ -2615,18 +2615,14 @@ def check_METADATA_Ensure_designer_simple_short_name(fb, family):
fb.ok('Designer is a simple short name')
-fp = None # This is a bug! Please see fontbakery issue #1159
-
-
def check_family_is_listed_in_GFDirectory(fb, family):
- global fp
fb.new_check("081", "METADATA.pb: Fontfamily is listed"
" in Google Font Directory ?")
url = ('http://fonts.googleapis.com'
'/css?family=%s') % family.name.replace(' ', '+')
try:
- fp = requests.get(url)
- if fp.status_code != 200:
+ r = requests.get(url)
+ if r.status_code != 200:
fb.error('No family found in GWF in %s' % url)
else:
fb.ok('Font is properly listed in Google Font Directory.')
@@ -2636,7 +2632,6 @@ def check_family_is_listed_in_GFDirectory(fb, family):
def check_METADATA_Designer_exists_in_GWF_profiles_csv(fb, family):
- global fp # This is a bug! Please see fontbakery issue #1159
fb.new_check("082", "METADATA.pb: Designer exists in GWF profiles.csv ?")
if family.designer == "":
fb.error('METADATA.pb field "designer" MUST NOT be empty!')
@@ -2645,9 +2640,9 @@ def check_METADATA_Designer_exists_in_GWF_profiles_csv(fb, family):
"so we won't look for it at profiles.cvs")
else:
try:
- fp = urllib.urlopen(PROFILES_RAW_URL)
+ handle = urllib.urlopen(PROFILES_RAW_URL)
designers = []
- for row in csv.reader(fp):
+ for row in csv.reader(handle):
if not row:
continue
designers.append(row[0].decode('utf-8'))
