[TxMt] Parsing plist with escape char
Per Persson
persquare at mac.com
Thu Sep 29 10:11:21 UTC 2016
Hi,
I have a small utility that auto-generates documentation for the commands in a tmbundle by extracting key-combo and documentation comments from the command files, see:
https://github.com/persquare/CalvinScript.tmbundle/blob/master/Support/lib/help_gen.py
It works mostly well, but trying to parse a command file that contains a command mapped to the escape key using plistlib/biplist fails with an exception:
InvalidPlistException: ExpatError('not well-formed (invalid token): line 18, column 9',)
The (python) code to trigger is simple enough, plistlib or biplist doesn't matter:
try:
import biplist as plistlib
except:
import plistlib
for file in os.listdir(path_to_cmd_dir_in_tmbundle):
path = unicode(os.path.join(cmd_dir, file), 'utf-8')
pl = plistlib.readPlist(path)
Any clues how to handle this?
/Per
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20160929/baf2e0b0/attachment-0001.html>
More information about the textmate
mailing list