[RELEASE] Repository Preparer (update to addons_xml_generator.py)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #1
Repository Preparer
(repo_prep.py)


Could an admin please sticky this? I think repository owners will find this very useful.

I've written an update / replacement to addons_xml_generator.py

The latest version will always be hosted here
https://github.com/unobtanium/xbmc_repo_...po_prep.py

Which you can download from here:
https://raw.github.com/unobtanium/xbmc_r...po_prep.py

This includes some code improvements and a function to automatically generate a compressed repository structure.

So now you get the benefits of compressing your addons without the having to manually rename the changelog, zip the file etc, just by running repo-prep.py when you need to update your addons.xml

Full readme:

Quote:This is an:
- addons.xml generator
- addons.xml.md5 generator
- optional auto-compressor (including handling of icons, fanart and changelog)

Compression of addons in repositories has many benefits, including:
- Protects addon downloads from corruption.
- Smaller addon filesize resulting in faster downloads and less space / bandwidth used on the repository.
- Ability to "roll back" addon updates in XBMC to previous versions.

To enable the auto-compressor, set the compress_addons setting to True
NOTE: the settings.py of repository aggregator will override this setting.
If you do this you must make sure the "datadir zip" parameter in the addon.xml of your repository file is set to "true".
(This post was last modified: 2012-05-06 18:06 by unobtanium.)
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #2
works perfect, cheers Big Grin
find quote
paddycarey Offline
Senior Member
Posts: 246
Joined: Sep 2009
Reputation: 8
Post: #3
just in the middle of modifying this to work in a little project i'm writing, but I was just wondering if there are any disadvantages to requiring compression? i.e. can I safely strip out the non-compressed code path without side-effects?
(This post was last modified: 2012-04-25 23:44 by paddycarey.)
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #4
not sure i follow, you'll have to try it and see if it works i guess Wink
find quote
spiff Offline
Grumpy Bastard Developer
Posts: 12,234
Joined: Nov 2003
Reputation: 82
Post: #5
no advantage to non-compressed. only disadvantages (rollbacks no working, no quick reinstall).

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
Nuka1195 Online
Skilled Python Coder
Posts: 3,938
Joined: Dec 2004
Reputation: 17
Post: #6
nice job, i just updated the addons_xml_generator.py for python 2.6. not sure if you've done that in yours.

For python coding questions first see http://mirrors.xbmc.org/docs/python-docs/
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #7
thanks, i use python 2.7, and its worked for me. my changes to the xml generator were a bit more verbosity, and a check that it found at least one addon.xml before saving the xml and md5 files.

i'm not happy with the speed with which the update check takes, so i might remove that feature altogether to be honest
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #8
removed the update feature and added a few code tweaks
find quote
divingmule Offline
Posting Freak
Posts: 1,278
Joined: Oct 2008
Reputation: 54
Post: #9
I'm getting SyntaxError with your latest code.
Code:
E:\Eden_Repo>python repo_prep.py
  File "repo_prep.py", line 242
    for root, dirs, files in os.walk(dir):
                                         ^
SyntaxError: invalid syntax

The previous commit seemed to work fine. Thanks for your efforts.
find quote
unobtanium Offline
Junior Member
Posts: 10
Joined: Apr 2012
Reputation: 0
Post: #10
thanks, i've fixed it now and pushed it to github. you can get the latest version from the links in the first post
find quote
Post Reply