1 of 6
1
TEA for Espresso, 1.0
Posted: 01 March 2009 08:46 AM   [ Ignore ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Hey folks,

I’m happy to announce that TEA for Espresso is officially at version 1.0.  Download it here and install it like any other Sugar:

http://onecrayon.com/downloads/TEAforEspresso.zip

Features:

- My favorite Textmate HTML actions (Wrap Selection in Tag, Insert Open/Close Tag with Current Word, Wrap Selection in Link, etc.)
- The ability to add your own actions, whether by using generic TEA actions with different snippets via XML or writing completely custom scripts in Python (making use of the helper functions that TEA provides)
- 100% Python, with source code freely available under the MIT license at the GitHub tea-for-espresso project for anyone interested in creating Python Sugar actions outside of TEA
- I’ve stuck some pretty extensive documentation for the Sugar and how you can customize/extend it over at the GitHub wiki for those who want to test out the waters

Caveats:

- There’s no good way to edit current TEA actions without delving into the Sugar and modifying the XML files.

Please let me know any feedback that you have!

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 01 March 2009 06:22 PM   [ Ignore ]   [ # 1 ]
Sr. Member
RankRankRankRank
Total Posts:  205
Joined  2008-10-28

This is fantastic! Great work. It should have been in the default html sugar all along.

 Signature 

PHP.sugar

“Quick! Get in the Tardis!”

Profile
 
 
Posted: 01 March 2009 07:34 PM   [ Ignore ]   [ # 2 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

A lot of the functionality that’s cool about this Sugar is actually already baked into Espresso; there’s just no easy interface to create your own snippets (or published method to insert and modify selected text in a snippet).

My hope is that Jan will add an interface to allow users to easily add and edit snippets of their own without editing XML, since ideally the TEA plugin should only be needed for actions that require more extensive internal logic than “wrap selected text in such and such a snippet when such and such a hotkey is invoked”.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 01 March 2009 07:41 PM   [ Ignore ]   [ # 3 ]
Sr. Member
RankRankRankRank
Total Posts:  205
Joined  2008-10-28

Yeah I hear ya, but this will definitely tide me over until then.

 Signature 

PHP.sugar

“Quick! Get in the Tardis!”

Profile
 
 
Posted: 02 March 2009 05:05 AM   [ Ignore ]   [ # 4 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

If you’ve already downloaded TEA for Espresso beta 1 and are going to use Insert Tag From Word, please redownload.  I stupidly was only allowing alphabetical characters in the word, which of course meant it was failing on H1, H2, etc.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 13 March 2009 04:21 PM   [ Ignore ]   [ # 5 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Known bug: text snippets aren’t auto-completing themselves right.  This was working when I initially tested it (if I remember correctly), but now closing tags are being populated with everything in the opening tag.  As best I can tell there’s a bug in Espresso that’s preventing Textmate-style mirroring from working, but I will experiment and see if anything I’m doing in the TEA code is causing the problem.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 18 March 2009 08:12 AM   [ Ignore ]   [ # 6 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

I’ve updated TEA for Espresso to beta 2.  Aside from some code shuffling, which won’t matter to anyone since no one is currently playing with the source that I know of, the only change is the addition of the Convert to Named Entities and Convert to Numeric Entities actions.  Behavior is as follows:

* Select some text, and run the action to convert all non-ASCII characters into their HTML entity equivalents
* Invoke the action without a selection and it will run on the character immediately to the left of your cursor
* If you use Convert to Named Entities and you have a high-value Unicode character that doesn’t have a named equivalent, it will automatically be converted to a numeric entity instead
* Quotes, less than/greater than symbols, and other stuff that’s necessary for HTML tags should not be touched, so feel free to select text that has HTML scattered in it

Let me know if you run into any problems or would like to see any improvements!

This release was less interesting than I was hoping because most of the fixes and improvements I have planned for current actions are dependent on bug fixes or improvements in Espresso, but I wanted to release it anyway because some other folks were needing character entity conversion.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 20 March 2009 11:10 PM   [ Ignore ]   [ # 7 ]
Newbie
Rank
Total Posts:  11
Joined  2009-03-20

Firstly, nice work. Love espresso but I’m used to TextMate bundles so without this it isn’t for me.

After installing B2 (from your download link) when doing copy<tab>, I get the following error:

Error: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'typeIdentifier' 

Also, when doing the html tag completion shortcut, it dies if there is nothing to complete.

Error: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'isalpha' 

I’m not sure if it is meant to, but your latest Git version doesn’t even load into Espresso for me..

Thanks, again.

Profile
 
 
Posted: 20 March 2009 11:22 PM   [ Ignore ]   [ # 8 ]
Newbie
Rank
Total Posts:  11
Joined  2009-03-20

Ok, just realised that the first error only happens when the document is empty..

Profile
 
 
Posted: 20 March 2009 11:45 PM   [ Ignore ]   [ # 9 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Hey there,

Glad to hear the Sugar is useful!  If you’re trying to run the stuff from GitHub, you have to compile it first (since it’s a Cocoa plugin rather than a standard XML-based syntax Sugar).  If you’d like to do this, once you’ve run your `git clone` command, `ls` to the newly created tea-for-espresso directory and run `python setup.py py2app`.  The Sugar will show up in a new `dist` directory, and you can just drag it to your Sugars folder and relaunch Espresso.  (That said, GitHub is currently identical to the version in the zip, so this shouldn’t change anything.)

For the errors, I’m not sure which action you’re using that’s failing (for the first error).  For the second, it sounds like my error checking isn’t comprehensive enough for blank selections; I’ll take a look at that.

Thanks for reporting the errors!

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 20 March 2009 11:58 PM   [ Ignore ]   [ # 10 ]
Newbie
Rank
Total Posts:  11
Joined  2009-03-20
George the Flea - 20 March 2009 11:45 PM
For the errors, I’m not sure which action you’re using that’s failing (for the first error).  For the second, it sounds like my error checking isn’t comprehensive enough for blank selections; I’ll take a look at that.

The first error is when the document is empty, and you try any tab-completion snippet. It needs to have something in it, even a space works.

Another bug :D :

Error: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'stringValue' 


Appears when you open a brand new document with no language selected. Any text-snippet dies with this error. Assign a language and all fine afterwards.

Profile
 
 
Posted: 21 March 2009 02:04 AM   [ Ignore ]   [ # 11 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Work was super boring, so I took a break and fixed these bugs.  The bug fixes are currently only in GitHub (the beta 2 download will still have the bugs).  rdougan, I’ll send you a new build via PM for you to test out if you’d like (can’t upload zip files to threads, but can to PMs; go figure).

Let me know if the bugs recur, you come across any other problems, have any feature requests, etc.!

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 21 March 2009 03:54 AM   [ Ignore ]   [ # 12 ]
Newbie
Rank
Total Posts:  11
Joined  2009-03-20
George the Flea - 21 March 2009 02:04 AM

Work was super boring, so I took a break and fixed these bugs.  The bug fixes are currently only in GitHub (the beta 2 download will still have the bugs).  rdougan, I’ll send you a new build via PM for you to test out if you’d like (can’t upload zip files to threads, but can to PMs; go figure).

Let me know if the bugs recur, you come across any other problems, have any feature requests, etc.!

Just tested this version out and the bugs seem to be gone- Nice one!

I’m currently working on a JavaScript snippets ‘bundle’ now. It would be cool if you could link up multiple action files and not just UserActions/UserCategories. Not sure how you’d do that though as I see you are currently using symlinks.

Update:

Another bug, if the text-trigger is not at the start of the line, or there is anything else on the line ’ div’ or ‘div o hai der’, where ‘div’ is the trigger.

Error: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'stringValue' 

Update #2:

If there is nothing in the file and a language IS set, the earlier bug appears again:

Error: <type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'typeIdentifier' 


Fine if the language isn’t set/something already in the file.

Profile
 
 
Posted: 21 March 2009 05:37 AM   [ Ignore ]   [ # 13 ]
Newbie
Rank
Total Posts:  11
Joined  2009-03-20

I have just finished porting the TextMate JavaScript snippets over to this, plus mine and edspencers ExtJS/JSDoc tmbundle. You can find it over on Github.

Profile
 
 
Posted: 21 March 2009 07:09 AM   [ Ignore ]   [ # 14 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

Wonderful!  I’ll definitely take a look.

Do note, though, that there’s currently a bug in Espresso that’s causing mirrored snippets to not work quite right (you can see this with Wrap Selection In Tag, for instance).

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
Posted: 21 March 2009 07:44 AM   [ Ignore ]   [ # 15 ]
Moderator
RankRankRankRank
Total Posts:  989
Joined  2008-10-28

I’ve bumped TEA for Espresso to beta 3.  Beta 3 contains bug fixes for the errors that Robert found, and adds symlinks so that you can take advantage of the Javascript snippets that rdougan ported without needing to use your UserActions.xml file for them.  To have TEA for Espresso automatically pick up on Robert’s Javascript actions do this:

cd ~/Library/Application\ Support/Espresso/TEA/
git clone git://github.com/rdougan/tea-for-espresso_javascript-extjs-jsdoc.git Javascript 

Then rename the UserActions.xml in the Javascript folder to Actions.xml, and UserCategories.xml to Categories.xml.  Relaunch Espresso and enjoy your Javascript snippets.

Just a note: my hope is that Jan will add an interface element that will blow TEA for Espresso’s text snippet support away (or at the very minimum add an easy way to create simple tab-completions via XML that’s less complicated than that necessitated by TEA for Espresso and doesn’t require a Sugar), so hopefully this symlink-driven solution will be short-lived.  However, in the meantime if other folks have any collections of snippets that they think would be useful to include just give me a shout.  Adding symlinks is easy.

 Signature 

Ian Beck
MacRabbit Support

My stuff:
TEA (docs / source) .:. Spice.sugar .:. HTMLBundle.sugar .:. Quiet Light & Earthworm

Profile
 
 
   
1 of 6
1