Download
(149 Kb)
Download
Updated: 09-23-11 03:05 AM
Pictures
File Info
Updated:09-23-11 03:05 AM
Created:02-24-09 02:07 AM
Downloads:2,148
Favorites:5
MD5:
Wuiup
Version: 0.40
by: MaikuMori [More]
Please leave a comment if you use it or if you have any ideas/feature requests.

Known issues:
- Doesn't work with .rar files. I haven't found a nice rar library for python (rarlib is annoying) and I don't have time to roll my own lib for rarfiles. I could apply some OS specific fixes.. (Please addon authors, use .zip files, .rar files are evil and doesn't work out of box on some OSes)

_____________________________________________________________________


Wow User Interface UPdater or Wuiup for short is a little script which I wrote because I had a lot of addons which needed manual config/fixes each time they were updated.

Features:
  • Updates addons which you have added to your favorite list on WowInterface.
  • Has the ability to execute custom "hooks" before and after each update which basically allows you to back up some files and/or patch in your config/file changes.
  • Supports custom updaters which can update addon not hosted on WowInterface or which are rarely updated there.

Requirements:
Python 2.6 or 2.7 (I haven't tested it with 2.5 it might/might not work with it.)

How it works:
Wuiup downloads and keeps local version number of all addons which are in your wowinterface.com favorites. If version on wowinterface is different then local version it will download new version from wowinterface.com, delete old local copy and extract new version in wow addon directory.

Usage:
Usually you just want to launch wuiup.py file. Or you can make a shortcut to update.bat (on windows), there's also an icon file if you want to assign an icon the shortcut. If you have your python install at some specific place, just edit the .bat .

There are some command-line switches. You can get more info by runing wuiup.py with with -h switch.

What are custom updaters and how they work?
By default Wuiup will only update addons in your wowinterface favorites. If you want to update addon which is not hosted in wowinterface you need to write your own custom updater. How to do that?

First you want to make a new file in ./updaters/ directory and call it something, for example wim.py (since I'm going to write custom updater for WIM).
In that file you need to import custom updater abstract class:
Code:
from updaters import Updater
Then all you need to do is make a subclass of Updater with a method called update which takes 1 parameter, local version of addon or None if there's no info about local version. This method must return newly installed/updated version or False if update failed for some reason.
Code:
def update(self,cv):
    self.current_version = cv
    try:
        last_version = False
        if self.logging:
            self.logging.info("Pretending to update WIM" if self.current_version or "Pretending to install WIM")
        last_version = self._some_method_which_actually_updates_addon()
        return last_version
    except:
        #Something bad happended
        return False
There's working example in ./updaters/wim.py

What does hooks do and how they work?
Before and after Wuiup updates addon from wowinterface.com or updates one using custom updater it checks if that addon has "before updater" and/or "after update" hooks installed.

How can I install / write such hooks?

All hooks are located in ./hooks/ directory. Filename of each hook is actually adddon_id + ".py" . For wowinterface.com addons, their IDs are their original wowinterface.com IDs.
To get ID of addon which is hosted on wowinterface.com you need to go to it's webpage and then look at pages url, for example:
Code:
http://www.wowinterface.com/downloads/info11361-Overachiever.html
ID is the number between info and -nameofaddon. In this case 11361.
So if you would want to write a hook which gets called when Overachiever is updated, you would make a file called 11361.py in ./hooks/ directory.
In that file you need to import hook abstract:
Code:
from hooks import AddonHookAbstract
And make an subclass of AddonHookAbstract called AddonHook, no other name will work at the moment. Now there's 2 method which you can overwrite -beforeUpdateHook() and afterUpdateHook(). Both should return True if everything worked or False if something went wrong.
Here's a small example:
Code:
class AddonHook(AddonHookAbstract):
    def afterUpdateHook(self):
        replaces = {"local bBuffs = true" : "local bBuffs = false",
            "local pBuffs = true" : "local pBuffs = false",
            "local pDebuffs = true" : "local pDebuffs = false",
            "278.5, -174)" : "278.5, -40)",
            "UIParent, 'TOPLEFT', 15, -15)" : "UIParent, 'TOPLEFT', 15, -60)"}
        file_location = os.path.join(self.wowdir,'oUF_Caellian/oUF_cMain.lua')
        return self._replace_text(file_location,replaces)
To add addon hosted on curse take a look at curse custom updater. Use at your own risk.

If you can't figure out how to set it up - you are probably better off with another updater.
0.40
+Added simple support for addons hosted at Curse. Better integration requires bigger rewrite. Use at your own risk.
*Fixed DBM custom updater to support their new website.
*Some other minor fixes.

0.32
*minior fixes
*added oUF_Freeb hook to examples

0.31
*Fixed several bugs which could cause the updater to lose it's datafile.
*Some really small tweaks.
Optional Files (0)


Archived Files (3)
File Name
Version
Size
Author
Date
0.40
27kB
MaikuMori
08-31-09 06:49 AM
0.31
10kB
MaikuMori
06-27-09 06:53 PM
0.3
10kB
MaikuMori
02-24-09 02:07 AM


Post A Reply Comment Options
Old 01-19-12, 06:19 AM  
MaikuMori
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 27
Uploads: 2
It works once again.

---------------------------

After some changes in wowinterface webpage, the updater currently doesn't work.

I've posted a bug report (http://www.wowinterface.com/forums/s...ad.php?t=42398) and it should be fixed soon. If not I'll just make update with a workaround.
Last edited by MaikuMori : 01-23-12 at 09:36 PM.
MaikuMori is offline Report comment to moderator  
Reply With Quote
Old 09-26-11, 01:29 PM  
MaikuMori
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 27
Uploads: 2
I'm thinking about redesigning at least part of the code. Specifically adding curse updater to the main part of the code instead of as custom updater, but I just can't seem to figure out a nice way how to save which addons to update.

Curse has something similar to wowinterface favorite list, but there's no easy access to them. (At least none that I know of)

It could be some sort of config file.

Any ideas how you would like to save the list of addons?

P.S.
I don't think I'll add GUI anytime soon as I really like how it's 1-click update at the moment.
MaikuMori is offline Report comment to moderator  
Reply With Quote
Old 09-23-11, 10:19 AM  
Baine
A Murloc Raider
 
Baine's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 364
Uploads: 2
ugly? yes, no doubt. but since i can't do better, i live with it and adopt to what's needed^^
__________________
Baine is offline Report comment to moderator  
Reply With Quote
Old 09-23-11, 07:41 AM  
MaikuMori
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 27
Uploads: 2
Yeah the way curseforge/wowace updates work at the moment is really ugly atm.
MaikuMori is offline Report comment to moderator  
Reply With Quote
Old 09-23-11, 06:00 AM  
Baine
A Murloc Raider
 
Baine's Avatar
AddOn Author - Click to view AddOns

Forum posts: 4
File comments: 364
Uploads: 2
just got this set up for my addons (using WoWI and curseforge/WoWACE)
works like a breeze, and once you get the hang to those custom updaters very easy to set up too!

thanks for this amazing tool, i love it
__________________
Baine is offline Report comment to moderator  
Reply With Quote
Old 08-24-10, 02:32 AM  
MaikuMori
A Murloc Raider
AddOn Author - Click to view AddOns

Forum posts: 7
File comments: 27
Uploads: 2
It's broken at the moment because WowInterface removed some files on their server which were used by the updater.

I might try to fix it somehow, but it depends if I can find a way around the problem with reasonably low request count to the server.

Here's the related discussion:

http://www.wowinterface.com/forums/s...ad.php?t=34605

EDIT: Looks like it's almost fixed by WoWI guys.
Last edited by MaikuMori : 08-24-10 at 04:42 PM.
MaikuMori is offline Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump:

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.