Sublime Forum

Package release: PackageDownloader

#1

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


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

  • AutomaticBackupsPlugin
  • PackageDownloaderPlugin

TO INSTALL:

  • lastly, restart Sublime Text, and press ctrl, alt, d. This will download all the packages.
0 Likes

Automatic Backup Plugin
#2

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.

0 Likes

#3

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

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: docs.python.org/lib/ctypes-funct … types.html

0 Likes

#4

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.

0 Likes

#5

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’.

0 Likes

#6

Cool stuff, I updated it via the package downloader too :slight_smile:

0 Likes

#7

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.

0 Likes

#8

Likewise, I haven’t run into any IOErrors with it.

0 Likes