diff options
author | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
---|---|---|
committer | Walter Purcaro <vuolter@gmail.com> | 2014-12-13 15:56:57 +0100 |
commit | acc46fc3497a66a427b795b4a22c6e71d69185a1 (patch) | |
tree | 2d315b838a76435fc456b972c99c28d1732b2f70 /locale | |
parent | Code fixes (diff) | |
download | pyload-acc46fc3497a66a427b795b4a22c6e71d69185a1.tar.xz |
Update
Diffstat (limited to 'locale')
-rw-r--r-- | locale/core.pot | 228 | ||||
-rw-r--r-- | locale/pavement.py | 415 |
2 files changed, 529 insertions, 114 deletions
diff --git a/locale/core.pot b/locale/core.pot index 47550a6aa..028c0c14e 100644 --- a/locale/core.pot +++ b/locale/core.pot @@ -214,8 +214,8 @@ msgstr "" msgid "unknown" msgstr "" -#: pyload/database/FileDatabase.py:531 pyload/plugins/hooks/IRCInterface.py:74 -#: pyload/plugins/hooks/XMPPInterface.py:83 +#: pyload/database/FileDatabase.py:531 pyload/plugin/hooks/IRCInterface.py:74 +#: pyload/plugin/hooks/XMPPInterface.py:83 #, python-format msgid "Package finished: %s" msgstr "" @@ -283,7 +283,7 @@ msgid "" msgstr "" #: pyload/threads/ServerThread.py:60 -msgid "Copy the boern.so to pyload/lib folder or use setup.py install" +msgid "Copy the boern.so to the lib folder or use setup.py install" msgstr "" #: pyload/threads/ServerThread.py:61 @@ -420,7 +420,7 @@ msgstr "" msgid "Info Fetching for %(name)s failed | %(err)s" msgstr "" -#: pyload/HookManager.py:90 pyload/plugins/Hook.py:103 +#: pyload/HookManager.py:90 pyload/plugin/Hook.py:103 #, python-format msgid "Error executing hooks: %s" msgstr "" @@ -466,414 +466,414 @@ msgstr "" msgid "Not enough space left on device" msgstr "" -#: pyload/plugins/Account.py:85 pyload/plugins/Account.py:90 +#: pyload/plugin/Account.py:85 pyload/plugin/Account.py:90 #, python-format msgid "Could not login with account %(user)s | %(msg)s" msgstr "" -#: pyload/plugins/Account.py:86 +#: pyload/plugin/Account.py:86 msgid "Wrong Password" msgstr "" -#: pyload/plugins/Account.py:243 +#: pyload/plugin/Account.py:243 #, python-format msgid "Your Time %s has wrong format, use: 1:22-3:44" msgstr "" -#: pyload/plugins/Account.py:269 +#: pyload/plugin/Account.py:269 #, python-format msgid "Account %s has not enough traffic, checking again in 30min" msgstr "" -#: pyload/plugins/Account.py:276 +#: pyload/plugin/Account.py:276 #, python-format msgid "Account %s is expired, checking again in 1h" msgstr "" -#: pyload/plugins/crypter/SerienjunkiesOrg.py:126 +#: pyload/plugin/crypter/SerienjunkiesOrg.py:126 msgid "Downloadlimit reached" msgstr "" -#: pyload/plugins/PluginManager.py:153 +#: pyload/plugin/PluginManager.py:153 #, python-format msgid "%s has a invalid pattern." msgstr "" -#: pyload/plugins/PluginManager.py:272 +#: pyload/plugin/PluginManager.py:272 #, python-format msgid "Error importing %(name)s: %(msg)s" msgstr "" -#: pyload/plugins/internal/MultiHoster.py:132 +#: pyload/plugin/internal/MultiHoster.py:132 msgid "No Hoster loaded" msgstr "" -#: pyload/plugins/accounts/BitshareCom.py:38 +#: pyload/plugin/accounts/BitshareCom.py:38 msgid "Activate direct Download in your Bitshare Account" msgstr "" -#: pyload/plugins/container/LinkList.py:64 +#: pyload/plugin/container/LinkList.py:64 msgid "LinkList could not be cleared." msgstr "" -#: pyload/plugins/AccountManager.py:88 +#: pyload/plugin/AccountManager.py:88 msgid "Account settings deleted, due to new config format." msgstr "" -#: pyload/plugins/hoster/BasePlugin.py:65 +#: pyload/plugin/hoster/BasePlugin.py:65 msgid "Authorization required (username:password)" msgstr "" -#: pyload/plugins/hoster/SimplydebridCom.py:23 -#: pyload/plugins/hoster/RealdebridCom.py:40 -#: pyload/plugins/hoster/FreeWayMe.py:39 pyload/plugins/hoster/ZeveraCom.py:21 -#: pyload/plugins/hoster/UnrestrictLi.py:52 -#: pyload/plugins/hoster/Vipleech4uCom.py:30 -#: pyload/plugins/hoster/Premium4Me.py:27 pyload/plugins/hoster/FastixRu.py:36 -#: pyload/plugins/hoster/SimplyPremiumCom.py:52 -#: pyload/plugins/hoster/MegaDebridEu.py:46 -#: pyload/plugins/hoster/AlldebridCom.py:38 -#: pyload/plugins/hoster/LinksnappyCom.py:29 -#: pyload/plugins/hoster/DebridItaliaCom.py:39 -#: pyload/plugins/hoster/RPNetBiz.py:28 -#: pyload/plugins/hoster/MultiDebridCom.py:40 -#: pyload/plugins/hoster/ReloadCc.py:26 pyload/plugins/hoster/OverLoadMe.py:38 -#: pyload/plugins/hoster/RehostTo.py:25 -#: pyload/plugins/hoster/PremiumizeMe.py:24 -#: pyload/plugins/hooks/RPNetBiz.py:45 +#: pyload/plugin/hoster/SimplydebridCom.py:23 +#: pyload/plugin/hoster/RealdebridCom.py:40 +#: pyload/plugin/hoster/FreeWayMe.py:39 pyload/plugin/hoster/ZeveraCom.py:21 +#: pyload/plugin/hoster/UnrestrictLi.py:52 +#: pyload/plugin/hoster/Vipleech4uCom.py:30 +#: pyload/plugin/hoster/Premium4Me.py:27 pyload/plugin/hoster/FastixRu.py:36 +#: pyload/plugin/hoster/SimplyPremiumCom.py:52 +#: pyload/plugin/hoster/MegaDebridEu.py:46 +#: pyload/plugin/hoster/AlldebridCom.py:38 +#: pyload/plugin/hoster/LinksnappyCom.py:29 +#: pyload/plugin/hoster/DebridItaliaCom.py:39 +#: pyload/plugin/hoster/RPNetBiz.py:28 +#: pyload/plugin/hoster/MultiDebridCom.py:40 +#: pyload/plugin/hoster/ReloadCc.py:26 pyload/plugin/hoster/OverLoadMe.py:38 +#: pyload/plugin/hoster/RehostTo.py:25 +#: pyload/plugin/hoster/PremiumizeMe.py:24 +#: pyload/plugin/hooks/RPNetBiz.py:45 #, python-format msgid "Please enter your %s account or deactivate this plugin" msgstr "" -#: pyload/plugins/hoster/FilesMailRu.py:98 +#: pyload/plugin/hoster/FilesMailRu.py:98 #, python-format msgid "" "There was HTML Code in the Downloaded File (%s)...redirect error? The " "Download will be restarted." msgstr "" -#: pyload/plugins/hoster/NetloadIn.py:145 -#: pyload/plugins/hoster/NetloadIn.py:169 +#: pyload/plugin/hoster/NetloadIn.py:145 +#: pyload/plugin/hoster/NetloadIn.py:169 msgid "File temporarily not available" msgstr "" -#: pyload/plugins/hoster/NetloadIn.py:182 +#: pyload/plugin/hoster/NetloadIn.py:182 #, python-format msgid "Netload: waiting between downloads %d s." msgstr "" -#: pyload/plugins/hoster/NetloadIn.py:213 +#: pyload/plugin/hoster/NetloadIn.py:213 #, python-format msgid "Netload: waiting for captcha %d s." msgstr "" -#: pyload/plugins/hoster/NetloadIn.py:251 +#: pyload/plugin/hoster/NetloadIn.py:251 msgid "Downloaded File was empty" msgstr "" -#: pyload/plugins/hoster/MegaDebridEu.py:49 +#: pyload/plugin/hoster/MegaDebridEu.py:49 #, python-format msgid "Impossible to connect to %s" msgstr "" -#: pyload/plugins/hoster/MegaDebridEu.py:89 +#: pyload/plugin/hoster/MegaDebridEu.py:89 #, python-format msgid "Impossible to debrid %s" msgstr "" -#: pyload/plugins/hoster/UploadedTo.py:129 +#: pyload/plugin/hoster/UploadedTo.py:129 msgid "API key invalid" msgstr "" -#: pyload/plugins/hoster/UploadedTo.py:153 +#: pyload/plugin/hoster/UploadedTo.py:153 #, python-format msgid "%s: Not enough traffic left" msgstr "" -#: pyload/plugins/hoster/UploadedTo.py:156 +#: pyload/plugin/hoster/UploadedTo.py:156 msgid "Traffic exceeded" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:99 +#: pyload/plugin/hoster/RapidshareCom.py:99 msgid "Rapidshare: Traffic Share (direct download)" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:126 -#: pyload/plugins/hoster/RapidshareCom.py:193 +#: pyload/plugin/hoster/RapidshareCom.py:126 +#: pyload/plugin/hoster/RapidshareCom.py:193 msgid "Already downloading from this ip address, waiting 60 seconds" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:130 +#: pyload/plugin/hoster/RapidshareCom.py:130 msgid "Invalid Auth Code, download will be restarted" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:198 +#: pyload/plugin/hoster/RapidshareCom.py:198 msgid "RapidShareCom: No free slots" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:201 +#: pyload/plugin/hoster/RapidshareCom.py:201 msgid "You need a premium account for this file" msgstr "" -#: pyload/plugins/hoster/RapidshareCom.py:203 +#: pyload/plugin/hoster/RapidshareCom.py:203 msgid "Filename reported invalid" msgstr "" -#: pyload/plugins/hoster/FileserveCom.py:100 +#: pyload/plugin/hoster/FileserveCom.py:100 msgid "Parallel download error, now waiting 60s." msgstr "" -#: pyload/plugins/hoster/FileserveCom.py:216 +#: pyload/plugin/hoster/FileserveCom.py:216 msgid "Not logged in." msgstr "" -#: pyload/plugins/hoster/MegaNz.py:56 +#: pyload/plugin/hoster/MegaNz.py:56 msgid "Decryption failed" msgstr "" -#: pyload/plugins/hoster/MegaNz.py:106 +#: pyload/plugin/hoster/MegaNz.py:106 msgid "No file key provided in the URL" msgstr "" -#: pyload/plugins/hoster/MegaNz.py:118 +#: pyload/plugin/hoster/MegaNz.py:118 msgid "Error code:" msgstr "" -#: pyload/plugins/Container.py:68 +#: pyload/plugin/Container.py:68 msgid "File not exists." msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:97 +#: pyload/plugin/hooks/UpdateManager.py:97 msgid "Not able to connect server to get updates" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:111 +#: pyload/plugin/hooks/UpdateManager.py:111 msgid "No pyLoad version available" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:118 +#: pyload/plugin/hooks/UpdateManager.py:118 #, python-format msgid "*** New pyLoad Version %s available ***" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:119 +#: pyload/plugin/hooks/UpdateManager.py:119 msgid "*** Get it here: https://github.com/pyload/pyload/releases ***" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:170 +#: pyload/plugin/hooks/UpdateManager.py:170 #, python-format msgid "New version of [%(type)s] %(name)s (v%(oldver)s -> v%(newver)s)" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:180 -#: pyload/plugins/hooks/UpdateManager.py:185 +#: pyload/plugin/hooks/UpdateManager.py:180 +#: pyload/plugin/hooks/UpdateManager.py:185 #, python-format msgid "Error when updating plugin %s" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:185 +#: pyload/plugin/hooks/UpdateManager.py:185 msgid "Version mismatch" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:196 +#: pyload/plugin/hooks/UpdateManager.py:196 #, python-format msgid "Removed blacklisted plugin: [%(type)s] %(name)s" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:204 +#: pyload/plugin/hooks/UpdateManager.py:204 msgid "Plugins updated and reloaded" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:206 +#: pyload/plugin/hooks/UpdateManager.py:206 msgid "*** Plugins have been updated, pyLoad will be restarted now ***" msgstr "" -#: pyload/plugins/hooks/UpdateManager.py:211 +#: pyload/plugin/hooks/UpdateManager.py:211 msgid "No plugin updates available" msgstr "" -#: pyload/plugins/hooks/IRCInterface.py:82 +#: pyload/plugin/hooks/IRCInterface.py:82 #, python-format msgid "Download finished: %(name)s @ %(plugin)s " msgstr "" -#: pyload/plugins/hooks/IRCInterface.py:95 +#: pyload/plugin/hooks/IRCInterface.py:95 #, python-format msgid "New Captcha Request: %s" msgstr "" -#: pyload/plugins/hooks/IRCInterface.py:96 +#: pyload/plugin/hooks/IRCInterface.py:96 #, python-format msgid "Answer with 'c %s text on the captcha'" msgstr "" -#: pyload/plugins/hooks/Premium4Me.py:29 +#: pyload/plugin/hooks/Premium4Me.py:29 msgid "Please add your premium.to account first and restart pyLoad" msgstr "" -#: pyload/plugins/hooks/HotFolder.py:81 +#: pyload/plugin/hooks/HotFolder.py:81 #, python-format msgid "Added %s from HotFolder" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:94 +#: pyload/plugin/hooks/ExtractArchive.py:94 #, python-format msgid "No %s installed" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:96 -#: pyload/plugins/hooks/ExtractArchive.py:101 +#: pyload/plugin/hooks/ExtractArchive.py:96 +#: pyload/plugin/hooks/ExtractArchive.py:101 #, python-format msgid "Could not activate %s" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:106 +#: pyload/plugin/hooks/ExtractArchive.py:106 msgid "Activated" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:108 +#: pyload/plugin/hooks/ExtractArchive.py:108 msgid "No Extract plugins activated" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:120 +#: pyload/plugin/hooks/ExtractArchive.py:120 #, python-format msgid "Package %s queued for later extracting" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:143 +#: pyload/plugin/hooks/ExtractArchive.py:143 #, python-format msgid "Check package %s" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:184 +#: pyload/plugin/hooks/ExtractArchive.py:184 #, python-format msgid "Extract to %s" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:199 +#: pyload/plugin/hooks/ExtractArchive.py:199 msgid "No files found to extract" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:206 +#: pyload/plugin/hooks/ExtractArchive.py:206 msgid "extracting" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:217 +#: pyload/plugin/hooks/ExtractArchive.py:217 msgid "Password protected" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:238 +#: pyload/plugin/hooks/ExtractArchive.py:238 msgid "Wrong password" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:246 +#: pyload/plugin/hooks/ExtractArchive.py:246 #, python-format msgid "Deleting %s files" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:253 +#: pyload/plugin/hooks/ExtractArchive.py:253 msgid "Extracting finished" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:259 +#: pyload/plugin/hooks/ExtractArchive.py:259 msgid "Archive Error" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:261 +#: pyload/plugin/hooks/ExtractArchive.py:261 msgid "CRC Mismatch" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:265 +#: pyload/plugin/hooks/ExtractArchive.py:265 msgid "Unknown Error" msgstr "" -#: pyload/plugins/hooks/ExtractArchive.py:317 +#: pyload/plugin/hooks/ExtractArchive.py:317 msgid "Setting User and Group failed" msgstr "" -#: pyload/plugins/hooks/ClickAndLoad.py:75 +#: pyload/plugin/hooks/ClickAndLoad.py:75 msgid "Click'N'Load: Port 9666 already in use" msgstr "" -#: pyload/plugins/hooks/CaptchaTrader.py:70 -#: pyload/plugins/hooks/Captcha9kw.py:60 -#: pyload/plugins/hooks/ExpertDecoders.py:51 +#: pyload/plugin/hooks/CaptchaTrader.py:70 +#: pyload/plugin/hooks/Captcha9kw.py:60 +#: pyload/plugin/hooks/ExpertDecoders.py:51 #, python-format msgid "%s credits left" msgstr "" -#: pyload/plugins/hooks/CaptchaTrader.py:118 +#: pyload/plugin/hooks/CaptchaTrader.py:118 msgid "Could not send response." msgstr "" -#: pyload/plugins/hooks/CaptchaTrader.py:136 +#: pyload/plugin/hooks/CaptchaTrader.py:136 msgid "Your CaptchaTrader Account has not enough credits" msgstr "" -#: pyload/plugins/hooks/LinkdecrypterCom.py:45 +#: pyload/plugin/hooks/LinkdecrypterCom.py:45 msgid "Crypter list not found" msgstr "" -#: pyload/plugins/hooks/LinkdecrypterCom.py:59 +#: pyload/plugin/hooks/LinkdecrypterCom.py:59 msgid "Crypter list is empty" msgstr "" -#: pyload/plugins/hooks/XMPPInterface.py:91 +#: pyload/plugin/hooks/XMPPInterface.py:91 #, python-format msgid "Download finished: %(name)s @ %(plugin)s" msgstr "" -#: pyload/plugins/hooks/Captcha9kw.py:94 +#: pyload/plugin/hooks/Captcha9kw.py:94 #, python-format msgid "New CaptchaID from upload: %s : %s" msgstr "" -#: pyload/plugins/hooks/Captcha9kw.py:130 +#: pyload/plugin/hooks/Captcha9kw.py:130 msgid "Your Captcha 9kw.eu Account has not enough credits" msgstr "" -#: pyload/plugins/hooks/ExternalScripts.py:54 +#: pyload/plugin/hooks/ExternalScripts.py:54 #, python-format msgid "Installed scripts for %s: " msgstr "" -#: pyload/plugins/hooks/ExternalScripts.py:69 +#: pyload/plugin/hooks/ExternalScripts.py:69 msgid "Script not executable:" msgstr "" -#: pyload/plugins/hooks/ExternalScripts.py:80 +#: pyload/plugin/hooks/ExternalScripts.py:80 #, python-format msgid "Error in %(script)s: %(error)s" msgstr "" -#: pyload/plugins/hooks/ExpertDecoders.py:96 +#: pyload/plugin/hooks/ExpertDecoders.py:96 msgid "Your ExpertDecoders Account has not enough credits" msgstr "" -#: pyload/plugins/hooks/RehostTo.py:32 +#: pyload/plugin/hooks/RehostTo.py:32 msgid "Please add your rehost.to account first and restart pyLoad" msgstr "" -#: pyload/plugins/hooks/PremiumizeMe.py:50 +#: pyload/plugin/hooks/PremiumizeMe.py:50 msgid "Please add a valid premiumize.me account first and restart pyLoad." msgstr "" -#: pyload/plugins/hooks/CaptchaBrotherhood.py:70 +#: pyload/plugin/hooks/CaptchaBrotherhood.py:70 #, python-format msgid "%d credits left" msgstr "" -#: pyload/plugins/Plugin.py:389 +#: pyload/plugin/Plugin.py:389 msgid "" "Pil and tesseract not installed and no Client connected for captcha " "decrypting" msgstr "" -#: pyload/plugins/Plugin.py:393 +#: pyload/plugin/Plugin.py:393 msgid "No captcha result obtained in appropiate time by any of the plugins." msgstr "" -#: pyload/plugins/Plugin.py:498 pyload/plugins/Plugin.py:532 +#: pyload/plugin/Plugin.py:498 pyload/plugin/Plugin.py:532 #, python-format msgid "Setting User and Group failed: %s" msgstr "" diff --git a/locale/pavement.py b/locale/pavement.py new file mode 100644 index 000000000..0cdfb4872 --- /dev/null +++ b/locale/pavement.py @@ -0,0 +1,415 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +from __future__ import with_statement + +from paver.easy import * +from paver.setuputils import setup +from paver.doctools import cog + +import os +import sys +import shutil +import re +from glob import glob +from tempfile import mkdtemp +from urllib import urlretrieve +from subprocess import call, Popen, PIPE +from zipfile import ZipFile + +PROJECT_DIR = path(__file__).dirname() +sys.path.append(PROJECT_DIR) + +options = environment.options +path("pyload").mkdir() + +extradeps = [] +if sys.version_info <= (2, 5): + extradeps += 'simplejson' + +setup( + name="pyload", + version="0.4.10", + description='Fast, lightweight and full featured download manager.', + long_description=open(PROJECT_DIR / "README.md").read(), + keywords = ("pyload", "download-manager", "one-click-hoster", "download"), + url="http://pyload.org", + download_url='http://pyload.org/download', + license='GPL v3', + author="pyLoad Team", + author_email="support@pyload.org", + platforms = ('Any',), + #package_dir={'pyload': "src"}, + packages=["pyload"], + #package_data=find_package_data(), + #data_files=[], + include_package_data=True, + exclude_package_data={'pyload': ["docs*", "scripts*", "tests*"]}, #exluced from build but not from sdist + # 'bottle >= 0.10.0' not in list, because its small and contain little modifications + install_requires=['thrift >= 0.8.0', 'jinja2', 'pycurl', 'Beaker', 'BeautifulSoup >= 3.2, < 3.3'] + extradeps, + extras_require={ + 'SSL': ["pyOpenSSL"], + 'DLC': ['pycrypto'], + 'lightweight webserver': ['bjoern'], + 'RSS plugins': ['feedparser'], + }, + #setup_requires=["setuptools_hg"], + entry_points={ + 'console_scripts': [ + 'pyLoadCore = pyLoadCore:main', + 'pyLoadCli = pyLoadCli:main' + ]}, + zip_safe=False, + classifiers=[ + "Development Status :: 5 - Production/Stable", + "Topic :: Internet :: WWW/HTTP", + "Environment :: Console", + "Environment :: Web Environment", + "Intended Audience :: End Users/Desktop", + "License :: OSI Approved :: GNU General Public License (GPL)", + "Operating System :: OS Independent", + "Programming Language :: Python :: 2" + ] +) + +options( + sphinx=Bunch( + builddir="_build", + sourcedir="" + ), + get_source=Bunch( + src="https://bitbucket.org/spoob/pyload/get/tip.zip", + rev=None, + clean=False + ), + thrift=Bunch( + path="../thrift/trunk/compiler/cpp/thrift", + gen="" + ), + virtualenv=Bunch( + dir="env", + python="python2", + virtual="virtualenv2", + ), + cog=Bunch( + pattern="*.py", + ) +) + +# xgettext args +xargs = ["--language=Python", "--add-comments=L10N", + "--from-code=utf-8", "--copyright-holder=pyLoad Team", "--package-name=pyLoad", + "--package-version=%s" % options.version, "--msgid-bugs-address='bugs@pyload.org'"] + +@task +@needs('cog') +def html(): + """Build html documentation""" + module = path("docs") / "pyload" + pyload.rmtree() + call_task('paver.doctools.html') + + +@task +@cmdopts([ + ('src=', 's', 'Url to source'), + ('rev=', 'r', "HG revision"), + ("clean", 'c', 'Delete old source folder') +]) +def get_source(options): + """ Downloads pyload source from bitbucket tip or given rev""" + if options.rev: options.url = "https://bitbucket.org/spoob/pyload/get/%s.zip" % options.rev + + pyload = path("pyload") + + if len(pyload.listdir()) and not options.clean: + return + elif pyload.exists(): + pyload.rmtree() + + urlretrieve(options.src, "pyload_src.zip") + zip = ZipFile("pyload_src.zip") + zip.extractall() + path("pyload_src.zip").remove() + + folder = [x for x in path(".").dirs() if x.name.startswith("spoob-pyload-")][0] + folder.move(pyload) + + change_mode(pyload, 0644) + change_mode(pyload, 0755, folder=True) + + for file in pyload.files(): + if file.name.endswith(".py"): + file.chmod(0755) + + (pyload / ".hgtags").remove() + (pyload / ".gitignore").remove() + #(pyload / "docs").rmtree() + + f = open(pyload / "__init__.py", "wb") + f.close() + + #options.setup.packages = find_packages() + #options.setup.package_data = find_package_data() + + +@task +@needs('clean', 'generate_setup', 'minilib', 'get_source', 'setuptools.command.sdist') +def sdist(): + """ Build source code package with distutils """ + + +@task +@cmdopts([ + ('path=', 'p', 'Thrift path'), + ('gen=', 'g', "Extra --gen option") +]) +def thrift(options): + """ Generate Thrift stubs """ + + print "add import for TApplicationException manually as long it is not fixed" + + outdir = path("pyload") / "remote" / "thriftbackend" + (outdir / "gen-py").rmtree() + + cmd = [options.thrift.path, "-strict", "-o", outdir, "--gen", "py:slots, dynamic", outdir / "pyload.thrift"] + + if options.gen: + cmd.insert(len(cmd) - 1, "--gen") + cmd.insert(len(cmd) - 1, options.gen) + + print "running", cmd + + p = Popen(cmd) + p.communicate() + + (outdir / "thriftgen").rmtree() + (outdir / "gen-py").move(outdir / "thriftgen") + + #create light ttypes + from pyload.remote.socketbackend.create_ttypes import main + main() + +@task +def compile_js(): + """ Compile .coffee files to javascript""" + + root = path("pyload") / "web" / "media" / "js" + for f in root.glob("*.coffee"): + print "generate", f + coffee = Popen(["coffee", "-cbs"], stdin=open(f, "rb"), stdout=PIPE) + yui = Popen(["yuicompressor", "--type", "js"], stdin=coffee.stdout, stdout=PIPE) + coffee.stdout.close() + content = yui.communicate()[0] + with open(root / f.name.replace(".coffee", ".js"), "wb") as js: + js.write("{% autoescape true %}\n") + js.write(content) + js.write("\n{% endautoescape %}") + + +@task +def generate_locale(): + """ Generates localization files """ + + EXCLUDE = ["BeautifulSoup.py", "pyload/cli", "web/locale", "web/ajax", "web/cnl", "web/pyload", + "setup.py"] + makepot("core", path("pyload"), EXCLUDE, "./pyload.py\n") + + makepot("cli", path("pyload") / "cli", [], includes="./pyload-cli.py\n") + makepot("setup", "", [], includes="./pyload/setup.py\n") + + EXCLUDE = ["ServerThread.py", "web/media/default"] + + # strings from js files + strings = set() + + for fi in path("pyload/web").walkfiles(): + if not fi.name.endswith(".js") and not fi.endswith(".coffee"): continue + with open(fi, "rb") as c: + content = c.read() + + strings.update(re.findall(r"_\s*\(\s*\"([^\"]+)", content)) + strings.update(re.findall(r"_\s*\(\s*\'([^\']+)", content)) + + trans = path("pyload") / "web" / "translations.js" + + with open(trans, "wb") as js: + for s in strings: + js.write('_("%s")\n' % s) + + makepot("django", path("pyload/web"), EXCLUDE, "./%s\n" % trans.relpath(), [".py", ".html"], ["--language=Python"]) + + trans.remove() + + path("includes.txt").remove() + + print "Locale generated" + + +@task +@cmdopts([ + ('key=', 'k', 'api key') +]) +def upload_translations(options): + """ Uploads the locale files to translation server """ + tmp = path(mkdtemp()) + + shutil.copy('locale/crowdin.yaml', tmp) + os.mkdir(tmp / 'pyLoad') + for f in glob('locale/*.pot'): + if os.path.isfile(f): + shutil.copy(f, tmp / 'pyLoad') + + config = tmp / 'crowdin.yaml' + content = open(config, 'rb').read() + content = content.format(key=options.key, tmp=tmp) + f = open(config, 'wb') + f.write(content) + f.close() + + call(['crowdin-cli', '-c', config, 'upload', 'source']) + + shutil.rmtree(tmp) + + print "Translations uploaded" + + +@task +@cmdopts([ + ('key=', 'k', 'api key') +]) +def download_translations(options): + """ Downloads the translated files from translation server """ + tmp = path(mkdtemp()) + + shutil.copy('locale/crowdin.yaml', tmp) + os.mkdir(tmp / 'pyLoad') + for f in glob('locale/*.pot'): + if os.path.isfile(f): + shutil.copy(f, tmp / 'pyLoad') + + config = tmp / 'crowdin.yaml' + content = open(config, 'rb').read() + content = content.format(key=options.key, tmp=tmp) + f = open(config, 'wb') + f.write(content) + f.close() + + call(['crowdin-cli', '-c', config, 'download']) + + for language in (tmp / 'pyLoad').listdir(): + if not language.isdir(): + continue + + target = path('locale') / language.basename() + print "Copy language %s" % target + if target.exists(): + shutil.rmtree(target) + + shutil.copytree(language, target) + + shutil.rmtree(tmp) + + +@task +def compile_translations(): + """ Compile PO files to MO """ + for language in path('locale').listdir(): + if not language.isdir(): + continue + + for f in glob(language / 'LC_MESSAGES' / '*.po'): + print "Compiling %s" % f + call(['msgfmt', '-o', f.replace('.po', '.mo'), f]) + + +@task +def tests(): + call(["nosetests2"]) + +@task +def virtualenv(options): + """Setup virtual environment""" + if path(options.dir).exists(): + return + + call([options.virtual, "--no-site-packages", "--python", options.python, options.dir]) + print "$ source %s/bin/activate" % options.dir + + +@task +def clean_env(): + """Deletes the virtual environment""" + env = path(options.virtualenv.dir) + if env.exists(): + env.rmtree() + + +@task +@needs('generate_setup', 'minilib', 'get_source', 'virtualenv') +def env_install(): + """Install pyLoad into the virtualenv""" + venv = options.virtualenv + call([path(venv.dir) / "bin" / "easy_install", "."]) + + +@task +def clean(): + """Cleans build directories""" + path("build").rmtree() + path("dist").rmtree() + + +#helper functions + +def walk_trans(path, EXCLUDE, endings=[".py"]): + result = "" + + for f in path.walkfiles(): + if [True for x in EXCLUDE if x in f.dirname().relpath()]: continue + if f.name in EXCLUDE: continue + + for e in endings: + if f.name.endswith(e): + result += "./%s\n" % f.relpath() + break + + return result + + +def makepot(domain, p, excludes=[], includes="", endings=[".py"], xxargs=[]): + print "Generate %s.pot" % domain + + f = open("includes.txt", "wb") + if includes: + f.write(includes) + + if p: + f.write(walk_trans(path(p), excludes, endings)) + + f.close() + + call(["xgettext", "--files-from=includes.txt", "--default-domain=%s" % domain] + xargs + xxargs) + + # replace charset und move file + with open("%s.po" % domain, "rb") as f: + content = f.read() + + path("%s.po" % domain).remove() + content = content.replace("charset=CHARSET", "charset=UTF-8") + + with open("locale/%s.pot" % domain, "wb") as f: + f.write(content) + + +def change_owner(dir, uid, gid): + for p in dir.walk(): + p.chown(uid, gid) + + +def change_mode(dir, mode, folder=False): + for p in dir.walk(): + if folder and p.isdir(): + p.chmod(mode) + elif p.isfile() and not folder: + p.chmod(mode) |