[quote=“quodlibet”]@facelessuser If you were to do this, why not add it to PlistJsonConverter? I mean apart from the name absurdity?
None of my business, how you run your plugin empire, of course [/quote]
The thought occurred to me, and it might actually be done that way in the end.
I don’t think it will be too tough to do. The whole thing is built around PyYaml. It seems pretty easy to get running, and they provide a python 3 and 2 version. There are still some issues I see. Apparently when converting from plist to a python object that can be fed to the yaml converter, plistlib doesn’t use straight up dictionaries, but it uses some class derived from dictionary. I will probably have to iterate through the python object and convert them all over to dictionary classes, but this isn’t a big deal. I am confident I can get a plugin going, you can see it is on its way (at least in a one way conversion form plist to yaml). I literally threw this together by dropping the pyyaml lib into PlistJsonConverter, and deriving a couple new classes from the the language convert class, but you can see it is starting to take shape:
[pre=#282828] begin: ^(("’]?)(repository)(\2))(
beginCaptures: !!python/object/new:plistlib._InternalDict
dictitems:
‘1’: !!python/object/new:plistlib._InternalDict
dictitems: {name: string.other.quoted-or-unquoted.yaml-tmlanguage}
‘2’: !!python/object/new:plistlib._InternalDict
dictitems: {name: punctuation.definition.string.yaml-tmlanguage}
‘3’: !!python/object/new:plistlib._InternalDict
dictitems: {name: entity.other.repository.yaml-tmlanguage}
‘4’: !!python/object/new:plistlib._InternalDict
dictitems: {name: punctuation.definition.string.yaml-tmlanguage}
‘5’: !!python/object/new:plistlib._InternalDict
dictitems: {name: keyword.control.definition.yaml-tmlanguage}
end: ^(?!\s*($|#))(?=\S)
name: meta.repository-block.yaml-tmlanguage
patterns:
- !!python/object/new:plistlib._InternalDict
dictitems: {include: ‘#comment’}
- !!python/object/new:plistlib._InternalDict
dictitems: {include: ‘#repository-key’}
- !!python/object/new:plistlib._InternalDict
dictitems: {include: ‘#patterns’}[/pre]
I am pretty busy, so don’t expect it in the next couple of days…but keep your eyes out.