Home Download Buy Blog Forum Support

ST3: ExportHtml

Re: ST3: ExportHtml

Postby facelessuser on Sat Feb 16, 2013 6:37 am

castles_made_of_sand wrote:https://github.com/sublimator/EditPreferences/blob/master/helpers.py

I got some <em>crap<em> there for getting files ... not very coherent as it's first pass code as working through understanding ST3 implications ...

I had my own package globbing function which returns paths with /$Package.sublime-package/ if it's a zip file ...

Didn't really come across a case like today when getting a package normalised path from the api that doesn't `imply` much ...


Cool, I will take a look at your stuff. I would like to leverage the work of dealing with package paths instead of wasting time doing it all myself from scratch. I just dont have the motivation right now :).
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: ExportHtml

Postby sublimator on Sat Feb 16, 2013 6:48 am

hrmm, maybe between the 3 of us we can extract a module that works in all cases and isn't too stupid inefficient

`Packages/PackageName/Asset.ext`
`/Abspath/Packages/PackageName/Asset.ext`
`/Abspath/Packages/PackageName.sublime-package/Asset.ext`

I guess each of these could somehow come from the following:

(sublime.packages_path(), sublime.installed_packages_path(), os.path.dirname(sublime.executable_path()))

I might start with extracting just path helper stuff into a new module/repo
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3: ExportHtml

Postby skuroda on Sat Feb 16, 2013 6:57 am

I'm doing some testing of it now. I'll post here in a little bit. How I'm writing it now, you can return either the content of the file being searched for, or it will be extracted to a temp directory and the path will be returned.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: ExportHtml

Postby sublimator on Sat Feb 16, 2013 6:58 am

ST2 = sublime.version()[:1] == '2'
ST3
= not ST2


I got as far as declaring some constants, then went FUCK THIS, hahaha

Death to ST2 I say!
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3: ExportHtml

Postby sublimator on Sat Feb 16, 2013 6:58 am

skuroda wrote:I'm doing some testing of it now. I'll post here in a little bit. How I'm writing it now, you can return either the content of the file being searched for, or it will be extracted to a temp directory and the path will be returned.


Cool, I might take @faceless lead and sit this one out too :)
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3: ExportHtml

Postby skuroda on Sat Feb 16, 2013 7:03 am

*Uploads the .pyc file to github* Ha take that! :D Alright I'd feel to mean doing that so that would never happen.
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: ExportHtml

Postby facelessuser on Sat Feb 16, 2013 7:13 am

castles_made_of_sand wrote:Cool, I might take @faceless lead and sit this one out too :)


Sit'n is where it's at :).
facelessuser
 
Posts: 1541
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: ExportHtml

Postby skuroda on Sat Feb 16, 2013 7:34 am

facelessuser wrote:
castles_made_of_sand wrote:Cool, I might take @faceless lead and sit this one out too :)


Sit'n is where it's at :).


Here you go you sit'n...ers? :D If you come across any issues or can think of any improvements, let me know.

https://gist.github.com/skuroda/4965913
skuroda
 
Posts: 676
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: ExportHtml

Postby sublimator on Sat Feb 16, 2013 7:37 am

Sitting down @ linux-st3 land :)
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3: ExportHtml

Postby sublimator on Sat Feb 16, 2013 7:43 am

Looks good :)

Python 3 AFAIK seems to auto magically open(f).read() as unicode, defaulting to utf8

Defaulting to utf8 might not hurt, but having a possibility to consistently get bytes back might be nice ...
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 648
Joined: Thu Mar 20, 2008 5:41 am

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: Google [Bot] and 9 guests