Home Download Buy Blog Forum Support

A (Very Basic) Package Manager

A (Very Basic) Package Manager

Postby guillermooo on Wed Aug 03, 2011 7:20 pm

PackageManager

Direct download: PackageManager.sublime-package

The name is quite pretentious, especially considering the meager features at the moment:

* Download .sublime-package files and copy to Installed Packages (non-blocking)
* Uninstall packages by deleting package folder from Packages and .sublime-package file from Installed Packages
* Check for updated versions of packages (blocking)
* Adding repo urls to the database (this might not be working, though)

It's been very little tested and generally hopes for the best: no error checking (not even for an inexistent Installed Packages folder), no proxy support, etc.

What it does is downloading a tip revision as a .zip file from GitHub repositories and performing renaming and copying as needed, so it isn't very smart. If people find it useful, though, I might improve it and eventually move it to the SublimeText org.

Warning: It might download harmful files and it might delete files you don't want deleted. Use at your own risk, etc. Hope you like it, though.

Check the readme on the BitBucket page for more info.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: A (Very Basic) Package Manager

Postby adzenith on Wed Aug 03, 2011 10:20 pm

...but how do I install the package manager itself? I need a package-manager manager! :(

seriously though, this is pretty cool. I'm gonna give it a try.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: A (Very Basic) Package Manager

Postby adzenith on Wed Aug 03, 2011 10:24 pm

The wiki link to download the .sublime-package has the wrong case: https://bitbucket.org/guillermooo/PackageManager/downloads/PackageManager.sublime-package instead of
https://bitbucket.org/guillermooo/packagemanager/downloads/PackageManager.sublime-package
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: A (Very Basic) Package Manager

Postby guillermooo on Wed Aug 03, 2011 10:31 pm

Oops. True. I never get around to updating my templates...

About installing the package manager, yeah, it must be done manually, at least for the time being (and in any case, always the first time). Just drop the .sublime-package file in Data/Installed Packages and create Installed Packages if it doesn't exist yet.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: A (Very Basic) Package Manager

Postby adzenith on Wed Aug 03, 2011 10:33 pm

Yeah, I was just kidding. :P

I don't know if you can do pull requests or whatever with Hg, but I duplicated Default (Windows).sublime-keymap, named it Default (OSX).sublime-keymap and changed all the ctrls to supers. Now I can actually check boxes. :) I'll let you know if I can install stuff.

Also, I already had CTags (sublimator's) installed but it says "UNINSTALLED" in the list—does it just only know if things are installed if they've been installed through it?

Thanks!
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: A (Very Basic) Package Manager

Postby guillermooo on Wed Aug 03, 2011 10:37 pm

Haha, yeah, I'm not very considerate with other platforms and pretty lazy too. I'll try to fix the key maps.

The package manager is pretty stupid. If there's a XXX package in Packages, but not a corresponding XXX.sublime-package in Installed Packages, it will asume it doesn't exist. :D There might be other similar bugs.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: A (Very Basic) Package Manager

Postby guillermooo on Wed Aug 03, 2011 10:38 pm

And I should read posts until the end... Yeah, what you say's right! :)
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: A (Very Basic) Package Manager

Postby adzenith on Wed Aug 03, 2011 10:44 pm

Excellent. :)
It'd be sweet if at the bottom of the table it printed a help message about how to install, uninstall, add, etc. I'm flipping back and forth between the keymap and the table to figure out how to do things. Is there an easy way to figure out the key mapped to a command? I started writing something but I don't want to hard-code values.
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Re: A (Very Basic) Package Manager

Postby guillermooo on Wed Aug 03, 2011 10:49 pm

@sublimator showed a preview of a very cool plugin that would do that; teleport you to commands/settings/key bindings. But I don't think he's published it yet? I think he won't until Jon adds monospace fonts to the quick panel, haha. Hope that happens before v3. In other words, I don't think there is any way of doing that atm, no.

I'll add the tips at the end. Cheers.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: A (Very Basic) Package Manager

Postby adzenith on Wed Aug 03, 2011 10:53 pm

I also just busted this out a little bit:
Code: Select all
--- /Users/nikolaus/Library/Application Support/Sublime Text 2/Packages/PackageManager/package_manager_ui.py Wed Aug  3 15:52:53 2011
+++ /Users/nikolaus/Library/Application Support/Sublime Text 2/Packages/PackageManager/package_manager_ui.py Wed Aug  3 15:52:58 2011
@@ -53,7 +53,14 @@

class PackageManagerUiCommand(sublime_plugin.WindowCommand):
     def run(self):
-        ui = self.window.new_file()
+        ui = None
+        for v in self.window.views():
+            if 'Package Manager - Sublime Text' == v.name():
+                ui = v
+                self.window.focus_view(ui)
+                break
+        if ui == None:
+            ui = self.window.new_file()
         ui.set_name('Package Manager - Sublime Text')
         draw_frame(ui)
         load_package_data(ui)
adzenith
 
Posts: 1214
Joined: Mon Oct 19, 2009 9:12 pm

Next

Return to Plugin Announcements

Who is online

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