waldobronchart/ShortcutMapper

How to deal with the colon?

numbbbbb opened this issue · 2 comments

I'm working on the emmet these days, and now I nearly finish it except one thing: I don't know how to deal with the colon in file name.

Because emmet is a plugin, so I want to use the format like 'Sublime Text: Emmet'. But when I set this string as the app_name in export.py, the file cannot be created correctly because I'm using the damn windows and the colon is not allowed in filename.

More details: I write some classes inheritanced from your adobe classes, and if I want to change the behavior in creating file, I have to inheritance and change the ApplicationConfig class and the AdobeExporter class. I don't think this is an elegant solution.

So what should I do?

Besides, should I put the new classes into shmaplib.emmet? As I said, my classes are inheritanced from your adobe classes, so now I put them in my raw_to_intermedia.py and export.py.

I think it would be better to have Emmet as a context in the application Sublime Text, instead of a full separate application.

So under /exporters your dir structure would be something like:

/exporters
    /sublime-text
        /intermediate
            sublime-text_3.json
        /raw
            sublime-text_3_emmet.xx (this file is your source for a list of emmet shortcuts)
            sublime-text_3.xx (eventually, we can add all other sublime-text shortcuts here)
        /scripts
            raw_to_intermediate.py (this takes all 'sublime_text_3*' files and combines it into one single intermediate json file in /intermediate)
            export.py (this takes the intermediate file and exports it to the web application

This weekend I added shortcuts for Autodesk Maya, have a look at those scripts as a starting point (/exporters/autodesk-maya/).

I've added some more classes to /shmaplib/intermediate.py, you can use these ones instead of the adobe classes. I'm going to refactor the adobe stuff into this.

Look at the documentation in: https://github.com/waldobronchart/ShortcutMapper/blob/gh-pages/shmaplib/intermediate.py

Notice the IntermediateShortcutData class has an extend(IntermediateShortcutData idata) function. You parse multiple sources into separate idata's and then merge them into one to get one single intermediate data file.

I propose for now, you just have the '_emmet' raw source and put it under the context "Plugin: Emmet".

Only promote new code to shmaplib if it is used for multiple applications (shared code).

I see. Thank you!

在 2014年6月2日,22:02,Waldo Bronchart notifications@github.com 写道:

I think it would be better to have Emmet as a context in the application Sublime Text, instead of a full separate application.

So under /exporters your dir structure would be something like:

/exporters
/sublime-text
/intermediate
sublime-text_3.json
/raw
sublime-text_3_emmet.xx (this file is your source for a list of emmet shortcuts)
sublime-text_3.xx (eventually, we can add all other sublime-text shortcuts here)
/scripts
raw_to_intermediate.py (this takes all 'sublime_text_3*' files and combines it into one single intermediate json file in /intermediate)
export.py (this takes the intermediate file and exports it to the web application
This weekend I added shortcuts for Autodesk Maya, have a look at those scripts as a starting point (/exporters/autodesk-maya/).

I've added some more classes to /shmaplib/intermediate.py, you can use these ones instead of the adobe classes. I'm going to refactor the adobe stuff into this.

Only promote new code to shmaplib if it is used for multiple applications (shared code).


Reply to this email directly or view it on GitHub.