Home Download Buy Blog Forum Support

Package release: PackageDownloader

Package release: PackageDownloader

Postby SteveCooperOrg on Fri Mar 28, 2008 1:41 am

I've just finished a package-downloading package, which should help us distribute our own sublime-packages.

---
Downloads all packages at http://www.sublimetextwiki.com/sublime-packages. When you restart sublime, these packages will be installed and run. Currectly, this list is;

* AutomaticBackupsPlugin
* PackageDownloaderPlugin

TO INSTALL:

* download the package from http://www.sublimetextwiki.com/sublime- ... me-package
* save it to c:\program files\sublime text\Pristine packages
* Add a keybinding; Preferences | Preferences | Key Bindings | Default, then add this line;

<binding key="ctrl+alt+d" command="downloadPackagesOnSublimeTextWiki"/>

* lastly, restart Sublime Text, and press ctrl, alt, d. This will download all the packages.
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Package release: PackageDownloader

Postby SteveCooperOrg on Fri Mar 28, 2008 1:48 am

I have no idea, yet, how best to control the distribution of community-contributed packages. Right now it's me, uploading my stuff to my own server. I'd like it to become as democratic as possible, as soon as possible, with others being able to distribute thier own work. For right now, though, it's just my packages, to demonstrate the concept.
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Package release: PackageDownloader

Postby jps on Fri Mar 28, 2008 2:04 am

Looking good! I'm now getting my automatic backups plugin downloaded automatically.

Code: Select all
class DownloadPackagesOnSublimeTextWikiCommand(sublimeplugin.TextCommand):


A few thoughts:

This should extend from sublimeplugin.ApplicationCommand, as you don't need a View. This way it'll work when there are no files open, for example.

You may also want to do the downloading in a worker thread.

Also, while eventually there will be options for plugins to display GUI controls and dialogs, in the short term you can use the win32 MessageBox api to display a 'New plugins downloaded, please restart' message box to the user. There's an example of doing it in the ctypes docs: http://docs.python.org/lib/ctypes-funct ... types.html
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Package release: PackageDownloader

Postby jps on Fri Mar 28, 2008 2:06 am

Also, if you include a file called Default.sublime-keymap in the package, then it'll be automatically merged into the default set of key bindings.

In this case you'd be better served by a menu item, but until that's up and running, this will give a simpler setup.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Package release: PackageDownloader

Postby SteveCooperOrg on Fri Mar 28, 2008 9:17 am

All done, except the thread downloading. It'll tell you the names of the packages you downloaded, and inform you that you need a restart to install them.
Also, there's a keybinding; ctrl+alt+d,ctrl+alt+p ; for 'Download Packages'.
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Package release: PackageDownloader

Postby jps on Sat Mar 29, 2008 12:23 am

Cool stuff, I updated it via the package downloader too :)
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Package release: PackageDownloader

Postby SteveCooperOrg on Sat Mar 29, 2008 9:06 am

Hi, S. I had no conflicts in the past using your script, and I'm on py2.5.2. Have updated the script, tho, and everything seems to work correctly still.
Maybe what you're looking for is at the http://www.sublimetextwiki.com
SteveCooperOrg
 
Posts: 193
Joined: Thu Mar 20, 2008 9:53 am

Re: Package release: PackageDownloader

Postby jps on Sat Mar 29, 2008 9:44 am

Likewise, I haven't run into any IOErrors with it.
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 3 guests