Skip to content

Commit d87d8e5

Browse files
committed
Further Python3 and organization updates
1 parent 9ae617a commit d87d8e5

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Python scripts
22

3-
Assortment of scripts that run on the command line, i.e. *Terminal* on Mac OS X, and *Command Prompt* on Windows.
3+
Assortment of scripts that run on the command line, i.e. *Terminal* on macOS, and *Command Prompt* on Windows.
44

55
## Description
66

@@ -124,13 +124,8 @@ Here is a list of the locations from which you may need to get the extra tools a
124124

125125
* [FontTools](https://github.com/fonttools/fonttools)
126126

127-
* ~[RoboFab](https://github.com/robofab-developers/robofab)~
128-
* ~[FontParts](https://github.com/robofab-developers/robofab)~
129-
130127
* [Type Supply Tools](https://github.com/typesupply)
131128
* defcon
132-
* ufo2fdk
133-
* woffTools
134129

135130
## General usage information
136131

generateSingleKernFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
import os
44
import sys

generateSingleMarkFiles.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/python
1+
#!/usr/bin/env python
22

33
import os
44
import sys
@@ -27,13 +27,18 @@
2727

2828
try:
2929
from defcon import Font
30-
except:
31-
print "ERROR: This script requires defcon. It can be downloaded from https://github.com/typesupply/defcon"
30+
except ImportError:
31+
print(
32+
"ERROR: This script requires defcon. "
33+
"It can be downloaded from https://github.com/typesupply/defcon")
3234
libraryNotFound = True
3335
try:
3436
import WriteFeaturesMarkFDK
35-
except:
36-
print "ERROR: This script requires WriteFeaturesMarkFDK.py. It can be downloaded from https://github.com/adobe-type-tools/python-modules"
37+
except ImportError:
38+
print(
39+
"ERROR: This script requires WriteFeaturesMarkFDK.py. "
40+
"It can be downloaded from "
41+
"https://github.com/adobe-type-tools/python-modules")
3742
libraryNotFound = True
3843

3944
if libraryNotFound:
@@ -49,8 +54,8 @@ def generateMarkFiles(font):
4954
ufoFont = Font(fontFileName)
5055
styleName = ufoFont.info.styleName
5156

52-
print '*******************************'
53-
print 'Exporting mark files for %s...' % (styleName)
57+
print('*******************************')
58+
print('Exporting mark files for %s...' % (styleName))
5459

5560
WriteFeaturesMarkFDK.MarkDataClass(
5661
ufoFont, folderPath, trimCasingTags,
@@ -68,7 +73,7 @@ def run():
6873

6974
# make sure the path is valid
7075
if not os.path.isdir(baseFolderPath):
71-
print 'Invalid directory.'
76+
print('Invalid directory.')
7277
return
7378

7479
# if a path is not provided, use the current directory
@@ -78,13 +83,13 @@ def run():
7883
t1 = time.time()
7984

8085
fontPath = os.path.abspath(sys.argv[-1])
81-
print fontPath
86+
print(fontPath)
8287

8388
if os.path.exists(fontPath) and fontPath.lower().endswith('.ufo'):
8489
generateMarkFiles(fontPath)
8590

8691
else:
87-
print "No fonts found"
92+
print("No fonts found")
8893
return
8994

9095
t2 = time.time()
File renamed without changes.

0 commit comments

Comments
 (0)