--- /dev/null
+[Package]
+name = 7-Zip
+homepage = http://www.7-zip.org/
+
+description = 7-Zip is a file archiver with a high compression ratio.
+
+url = http://downloads.sourceforge.net/sevenzip/7z%(version)s.exe
+
+version = 920
+++ /dev/null
-{
- "name": "7-Zip",
- "homepage": "http://www.7-zip.org/",
- "description": "7-Zip is a file archiver with a high compression ratio.",
- "URL": "http://downloads.sourceforge.net/sevenzip/7z920.exe"
-}
--- /dev/null
+[Package]
+name = CDBurnerXP
+homepage = http://cdburnerxp.se/
+
+description = CDBurnerXP is a free application to burn CDs and DVDs,
+ including Blu-Ray and HD-DVDs.
+
+url = http://download.cdburnerxp.se/msi/cdbxp_setup_%(version)s.msi
+
+version = 4.4.0.2971
+++ /dev/null
-{
- "name": "CDBurnerXP",
- "homepage": "http://cdburnerxp.se/",
- "description": "CDBurnerXP is a free application to burn CDs and DVDs, including Blu-Ray and HD-DVDs.",
- "URL": "http://download.cdburnerxp.se/msi/cdbxp_setup_4.4.0.2971.msi"
-}
--- /dev/null
+[Package]
+name = Evince
+homepage = http://projects.gnome.org/evince/
+
+description = Evince is a document viewer for multiple document formats.
+
+url = http://ftp.gnome.org/pub/GNOME/binaries/win32/evince/2.32/evince-%(version)s.msi
+
+version = 2.32.0.145
+++ /dev/null
-{
- "name": "Evince",
- "homepage": "http://projects.gnome.org/evince/",
- "description": "Evince is a document viewer for multiple document formats.",
- "URL": "http://ftp.gnome.org/pub/GNOME/binaries/win32/evince/2.32/evince-2.32.0.145.msi"
-}
--- /dev/null
+[Package]
+name = GIMP
+homepage = http://www.gimp.org/
+
+description = GIMP is the GNU Image Manipulation Program. It is a freely
+ distributed piece of software for such tasks as photo retouching, image
+ composition and image authoring.
+
+url = http://downloads.sourceforge.net/gimp-win/gimp-%(version)s-setup.exe?use_mirror=
+
+version = 2.8.0
+++ /dev/null
-{
- "name": "GIMP",
- "homepage": "http://www.gimp.org/",
- "description": "GIMP is the GNU Image Manipulation Program. It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring.",
- "URL": "http://downloads.sourceforge.net/gimp-win/gimp-2.8.0-setup.exe?use_mirror="
-}
--- /dev/null
+[Package]
+name = Inkscape
+homepage = http://inkscape.org/
+
+description = An Open Source vector graphics editor, with capabilities
+ similar to Illustrator, CorelDraw, or Xara X, using the W3C standard
+ Scalable Vector Graphics (SVG) file format.
+
+url = http://sourceforge.net/projects/inkscape/files/inkscape/%(version)s/Inkscape-%(version)s-1.exe/download
+
+version = 0.48.3.1
+++ /dev/null
-{
- "name": "Inkscape",
- "homepage": "http://inkscape.org/",
- "description": "An Open Source vector graphics editor, with capabilities similar to Illustrator, CorelDraw, or Xara X, using the W3C standard Scalable Vector Graphics (SVG) file format.",
- "URL": "http://sourceforge.net/projects/inkscape/files/inkscape/0.48.3.1/Inkscape-0.48.3.1-1.exe/download"
-}
--- /dev/null
+[Package]
+name = LibreOffice
+homepage = http://www.libreoffice.org/
+
+description = LibreOffice is the power-packed free, libre and open
+ source personal productivity suite for Windows, Macintosh and GNU/Linux.
+
+url = http://download.documentfoundation.org/libreoffice/stable/%(version)s/win/x86/LibO_%(version)s_Win_x86_install_multi.msi
+
+version = 3.5.3
+++ /dev/null
-{
- "name": "LibreOffice",
- "homepage": "http://www.libreoffice.org/",
- "description": "LibreOffice is the power-packed free, libre and open source personal productivity suite for Windows, Macintosh and GNU/Linux.",
- "URL": "http://download.documentfoundation.org/libreoffice/stable/3.5.3/win/x86/LibO_3.5.3_Win_x86_install_multi.msi"
-}
--- /dev/null
+[Package]
+name = LibreOffice Help Pack
+homepage = http://www.libreoffice.org/
+
+description = Localized Help Pack for LibreOffice
+
+url = http://download.documentfoundation.org/libreoffice/stable/%(version)s/win/x86/LibO_%(version)s_Win_x86_helppack_%(language)s.msi
+
+version = 3.5.3
+++ /dev/null
-{
- "name": "LibreOffice Help Pack",
- "homepage": "http://www.libreoffice.org/",
- "description": "Localized Help Pack for LibreOffice",
- "URL": "http://download.documentfoundation.org/libreoffice/stable/3.5.3/win/x86/LibO_3.5.3_Win_x86_helppack_%s.msi"
-}
--- /dev/null
+[Package]
+name = Mozilla Firefox
+homepage = http://www.mozilla.org/firefox/
+
+description = The Firefox browser is created by Mozilla, a non-profit
+ organization whose mission is to promote openness, innovation and
+ opportunity on the Web.
+
+url = http://download.mozilla.org/?product=firefox-%(version)s&os=win&lang=%(language)s
+
+version = 11.0
+++ /dev/null
-{
- "name": "Mozilla Firefox",
- "homepage": "http://www.mozilla.org/firefox/",
- "description": "The Firefox browser is created by Mozilla, a non-profit organization whose mission is to promote openness, innovation and opportunity on the Web.",
- "URL": "http://download.mozilla.org/?product=firefox-11.0&os=win&lang=%s"
-}
--- /dev/null
+[Package]
+name = Mozilla Thunderbird
+homepage = https://www.mozilla.org/thunderbird/
+
+description = Thunderbird is a free email application that's easy to set
+ up and customize - and it's loaded with great features!
+
+url = http://download.mozilla.org/?product=thunderbird-%(version)s&os=win&lang=%(language)s
+
+version = 11.0.1
+++ /dev/null
-{
- "name": "Mozilla Thunderbird",
- "homepage": "https://www.mozilla.org/thunderbird/",
- "description": "Thunderbird is a free email application that's easy to set up and customize - and it's loaded with great features!",
- "URL": "http://download.mozilla.org/?product=thunderbird-11.0.1&os=win&lang=%s"
-}
--- /dev/null
+[Package]
+name = Avast free antivirus
+homepage = http://avast.com/
+
+description = Avast free antivirus
+
+url = http://files.avast.com/iavs5x/setup_av_free.exe
--- /dev/null
+[Package]
+name = Pidgin
+homepage = http://pidgin.im/
+
+description = Pidgin is an easy to use and free chat client used by
+ millions. Connect to AIM, MSN, Yahoo, and more chat networks all at
+ once.
+
+url = http://sourceforge.net/projects/pidgin/files/Pidgin/%(version)s/pidgin-%(version)s.exe
+
+version = 2.10.3
+++ /dev/null
-{
- "name": "Pidgin",
- "homepage": "http://pidgin.im/",
- "description": "Pidgin is an easy to use and free chat client used by millions. Connect to AIM, MSN, Yahoo, and more chat networks all at once.",
- "URL": "http://sourceforge.net/projects/pidgin/files/Pidgin/2.10.3/pidgin-2.10.3.exe"
-}
--- /dev/null
+[Package]
+name = VLC Media Player
+homepage = http://www.videolan.org/
+
+description = VLC is a free and open source cross-platform multimedia
+ player and framework that plays most multimedia files as well as DVD,
+ Audio CD, VCD, and various streaming protocols.
+
+url = http://downloads.sourceforge.net/project/vlc/%(version)s/win32/vlc-%(version)s-win32.exe
+
+version = 2.0.1
+++ /dev/null
-{
- "name": "VLC Media Player",
- "homepage": "http://www.videolan.org/",
- "description": "VLC is a free and open source cross-platform multimedia player and framework that plays most multimedia files as well as DVD, Audio CD, VCD, and various streaming protocols.",
- "URL": "http://downloads.sourceforge.net/project/vlc/2.0.1/win32/vlc-2.0.1-win32.exe"
-}
--- /dev/null
+[Package]
+name = XP Antispy
+homepage = http://xp-antispy.org/
+
+description = The xp-AntiSpy is a little utility that lets you disable
+ some built-in update and authentication 'features' in WindowsXP.
+
+url = http://xp-antispy.org/downloads/4
+++ /dev/null
-{
- "name": "XP Antispy",
- "homepage": "http://xp-antispy.org/",
- "description": "The xp-AntiSpy is a little utility that lets you disable some built-in update and authentication 'features' in WindowsXP.",
- "URL": "http://xp-antispy.org/downloads/4"
-}
--- /dev/null
+; The DEFAULTS section is not strictly needed, it is here just as an
+; example, maybe in a future version it can go in some global config
+; file
+[DEFAULTS]
+language = en-US
+
+[Package]
+name = Example program
+homepage = http://example.com/
+description = Example program doesn't do anything useful that we know of.
+license = GPL
+
+; A URL can have parametric language and version
+url = http://example.com/program-%(version)s-%(language)s.zip
+
+version = 1.0
+md5 = 564ad4bb65013635017a04d5e7098b9e
+++ /dev/null
-{
- "name": "Example program",
- "homepage": "http://example.com/",
- "description": "Example program doesn't do anything useful that we know of.",
-
- /* A "%s" in the URL will be replaced with a language code,
- * this can be useful for localized downloads.
- */
- "URL": "http://example.com/program-0.1-%s.zip"
-}
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import re
import os
import sys
import glob
-import json
+import ConfigParser
import urllib2
from progressbar import Bar, ETA, FileTransferSpeed, Percentage, ProgressBar
CHUNK_SIZE = 8192
-def get_pkg(json_file):
- with open(json_file, mode='r') as f:
- pkg = json.load(f)
- basename = os.path.basename(json_file)
+def get_pkg(pkg_file):
+ config = ConfigParser.SafeConfigParser({'language': LANGCODE})
+ with open(pkg_file, mode='r') as f:
+ config.readfp(f)
+ pkg = dict(config.items('Package'))
+ basename = os.path.basename(pkg_file)
package_name = os.path.splitext(basename)[0]
pkg['package_name'] = package_name
f.close()
def process_all(path, cb):
- listing = glob.glob(os.path.join(path, '*.json'))
- for json_file in listing:
- pkg = get_pkg(json_file)
+ listing = glob.glob(os.path.join(path, '*.ini'))
+ for pkg_file in listing:
+ pkg = get_pkg(pkg_file)
if not pkg:
- sys.stderr.write("Error: cannot get a pkg for: %s\n" % json_file)
+ sys.stderr.write("Error: cannot get a pkg for: %s\n" % pkg_file)
continue
cb(pkg)
def download(pkg):
- # the "%s" in URLs are meant to be replaced with LANGCODE
- try:
- pkg_url = pkg['URL'] % LANGCODE
- except:
- pkg_url = pkg['URL']
- pass
-
+ pkg_url = pkg['url']
download_file(pkg_url, OUTPUT_DIR)