MCPcopy Create free account
hub / github.com/PageBot/PageBot / path2Extension

Function path2Extension

Lib/pagebot/toolbox/transformer.py:605–613  ·  view source on GitHub ↗

Answers the file extension of path. >>> path2Extension('/xxx/yyy/zzz/Agency_FB-Compressed.ufo') 'ufo' >>> path2Extension('/xxx/yyy/zzz/Agency_FB-Compressed.TTF') 'ttf'

(path)

Source from the content-addressed store, hash-verified

603 return '/'.join(path.split('/')[:-1])
604
605def path2Extension(path):
606 """Answers the file extension of path.
607
608 >>> path2Extension('/xxx/yyy/zzz/Agency_FB-Compressed.ufo')
609 'ufo'
610 >>> path2Extension('/xxx/yyy/zzz/Agency_FB-Compressed.TTF')
611 'ttf'
612 """
613 return path.split('.')[-1].lower()
614
615def path2ScaledImagePath(path, w=None, h=None, index=None, extension=None, scaledPath=None):
616 """Answer the path where scaled images go to, also altering their name. If

Callers 7

asFontPathFunction · 0.90
scaleImageMethod · 0.90
imageSizeMethod · 0.90
_scaleImageMethod · 0.90
elementFromPathFunction · 0.90
path2ScaledImagePathFunction · 0.85
path2FontNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected