dabo Commit
Revision 7285
Date: 2012-11-26 11:24:58 -0800 (Mon, 26 Nov 2012)
Author: Paul
Trac: http://trac.dabodev.com/changeset/7285
Changed:
U trunk/dabo/lib/reportWriter.py
Log:
Fixed up some code that assumed that a certain font directory would
exist.
Diff:
Modified: trunk/dabo/lib/reportWriter.py
===================================================================
--- trunk/dabo/lib/reportWriter.py 2012-11-15 13:35:41 UTC (rev 7284)
+++ trunk/dabo/lib/reportWriter.py 2012-11-26 19:24:58 UTC (rev 7285)
@@ -86,10 +86,15 @@
# Add the truetype font paths for the running system:
+fontPaths = []
if sys.platform[:3] == "lin":
- fontPaths = [os.path.join("/usr/share/fonts/truetype", d) for d in
os.listdir("/usr/share/fonts/truetype")]
+ pathsToCheck = ["/usr/share/fonts/truetype"]
+ for pathToCheck in pathsToCheck:
+ if os.path.isdir(pathToCheck):
+ fontPaths += [os.path.join(pathToCheck, d) for d in
os.listdir(pathToCheck)]
elif sys.platform[:3] == "dar":
- fontPaths = ["/Network/Library/Fonts", "/Library/Fonts",
"System/Library/Fonts", "%s/Library/Fonts" % os.path.expanduser("~")]
+ fontPaths += ["/Network/Library/Fonts", "/Library/Fonts",
"System/Library/Fonts",
+ "%s/Library/Fonts" % os.path.expanduser("~")]
elif sys.platform[:3] == "win":
fontPaths = [os.path.join(os.path.expandvars("%windir%"), "fonts")]
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-dev
Searchable Archives: http://leafe.com/archives/search/dabo-dev
This message:
http://leafe.com/archives/byMID/[email protected]