[Python-modules-commits] [transifex-client] 01/06: Imported Upstream version 0.11.1.1
Hans-Christoph Steiner
eighthave at moszumanska.debian.org
Thu Dec 22 14:39:01 UTC 2016
This is an automated email from the git hooks/post-receive script.
eighthave pushed a commit to tag p
in repository transifex-client.
commit eae499fa48dc4b444878ac9bbf61a005985867ea
Author: Hans-Christoph Steiner <hans at eds.org>
Date: Wed Feb 17 23:14:43 2016 +0100
Imported Upstream version 0.11.1.1
---
.gitignore | 7 +
DEVELOPMENT.rst | 21 +
MANIFEST.in | 1 +
PKG-INFO | 45 --
README.rst | 57 +-
appveyor.yml | 76 +++
circle.yml | 17 +
contrib/test_build.sh | 5 +
contrib/test_win_build.sh | 4 +
contrib/tx.ico | Bin 0 -> 24870 bytes
contrib/tx.spec | 29 +
contrib/tx_commands.sh | 12 +
requirements.txt | 1 +
setup.cfg | 5 -
setup.py | 70 +-
tox.ini | 12 +
transifex_client.egg-info/PKG-INFO | 45 --
transifex_client.egg-info/SOURCES.txt | 45 --
transifex_client.egg-info/dependency_links.txt | 1 -
transifex_client.egg-info/not-zip-safe | 1 -
transifex_client.egg-info/top_level.txt | 1 -
tx | 10 +-
txclib/__init__.py | 12 +-
txclib/commands.py | 2 +-
txclib/config.py | 2 +-
txclib/log.py | 2 +-
txclib/packages/__init__.py | 0
txclib/packages/urllib3/__init__.py | 58 --
txclib/packages/urllib3/_collections.py | 94 ---
txclib/packages/urllib3/connectionpool.py | 745 ---------------------
txclib/packages/urllib3/contrib/__init__.py | 0
txclib/packages/urllib3/contrib/ntlmpool.py | 120 ----
txclib/packages/urllib3/contrib/pyopenssl.py | 344 ----------
txclib/packages/urllib3/exceptions.py | 121 ----
txclib/packages/urllib3/fields.py | 177 -----
txclib/packages/urllib3/filepost.py | 101 ---
txclib/packages/urllib3/packages/__init__.py | 4 -
txclib/packages/urllib3/packages/ordered_dict.py | 260 -------
txclib/packages/urllib3/packages/six.py | 385 -----------
.../packages/ssl_match_hostname/__init__.py | 98 ---
txclib/packages/urllib3/poolmanager.py | 259 -------
txclib/packages/urllib3/request.py | 142 ----
txclib/packages/urllib3/response.py | 301 ---------
txclib/packages/urllib3/util.py | 626 -----------------
txclib/parsers.py | 7 +-
txclib/project.py | 19 +-
txclib/utils.py | 47 +-
txclib/web.py | 18 +-
48 files changed, 320 insertions(+), 4089 deletions(-)
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..508cc21
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+.tx
+*pyc
+*pyo
+*~
+*egg-info*
+/build
+/dist
diff --git a/DEVELOPMENT.rst b/DEVELOPMENT.rst
new file mode 100644
index 0000000..992e518
--- /dev/null
+++ b/DEVELOPMENT.rst
@@ -0,0 +1,21 @@
+Releasing
+=========
+
+To create a new release:
+
+1. Update local rep and update the version in ``setup.py``::
+
+ $ hg pull -u
+ $ vim setup.py
+
+2. Test::
+
+ $ python setup.py clean sdist
+ $ cd dist
+ $ tar zxf ...
+ $ cd transifex-client
+ ...test
+
+3. Package and upload on PyPI::
+
+ $ python setup.py clean sdist bdist_egg upload
diff --git a/MANIFEST.in b/MANIFEST.in
index 0e6f0c3..4f0a350 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,6 @@
include tx
include txclib/cacert.pem
+include requirements.txt
# Docs
include LICENSE README.rst
diff --git a/PKG-INFO b/PKG-INFO
deleted file mode 100644
index e00ad75..0000000
--- a/PKG-INFO
+++ /dev/null
@@ -1,45 +0,0 @@
-Metadata-Version: 1.1
-Name: transifex-client
-Version: 0.11.1.beta
-Summary: A command line interface for Transifex
-Home-page: https://www.transifex.com
-Author: Transifex
-Author-email: admin at transifex.com
-License: GPLv2
-Description:
- =============================
- Transifex Command-Line Tool
- =============================
-
- The Transifex Command-line Client is a command line tool that enables
- you to easily manage your translations within a project without the need
- of an elaborate UI system.
-
- You can use the command line client to easily create new resources, map
- locale files to translations and synchronize your Transifex project with
- your local repository and vice verca. Translators and localization
- managers can also use it to handle large volumes of translation files
- easily and without much hassle.
-
- Check the full documentation at
- http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles.
-
-
- Installing
- ==========
-
- You can install the latest version of transifex-client running ``pip
- install transifex-client`` or ``easy_install transifex-client``
- You can also install the `in-development version`_ of transifex-client
- with ``pip install transifex-client==dev`` or ``easy_install
- transifex-client==dev``.
-
- .. _in-development version: http://github.com/transifex/transifex-client/tarball/master#egg=transifex-client-dev
-
-Keywords: translation,localization,internationalization
-Platform: UNKNOWN
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
diff --git a/README.rst b/README.rst
index 0ed076d..60202b1 100644
--- a/README.rst
+++ b/README.rst
@@ -1,3 +1,8 @@
+.. image:: https://circleci.com/gh/transifex/transifex-client/tree/master.svg?style=shield&circle-token=33aafd984726261eff1b73278a0cf761382c478a
+ :target: https://circleci.com/gh/transifex/transifex-client/tree/master
+.. image:: https://ci.appveyor.com/api/projects/status/github/transifex/transifex-client?branch=master&svg=true
+ :target: https://ci.appveyor.com/project/transifex/transifex-client/branch/master
+
=============================
Transifex Command-Line Tool
@@ -14,16 +19,56 @@ managers can also use it to handle large volumes of translation files
easily and without much hassle.
Check the full documentation at
-http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles.
+http://docs.transifex.com/client/
Installing
==========
You can install the latest version of transifex-client running ``pip
-install transifex-client`` or ``easy_install transifex-client``
-You can also install the `in-development version`_ of transifex-client
-with ``pip install transifex-client==dev`` or ``easy_install
-transifex-client==dev``.
+install transifex-client`` or ``easy_install transifex-client``.
+
+
+Build transifex-client for Windows
+==================================
+
+1. Download transifex-client sources via git or github archive.
+
+ a. ``git clone https://github.com/transifex/transifex-client.git``
+ b. Download and unpack https://github.com/transifex/transifex-client/archive/master.zip
+
+2. Download and install Python_.
+
+ At this step choose right version of python: 2 or 3 and x86 or x86-64 instruction set.
+
+ Make sure pip marked for installation(default for latest installers).
+
+3. Install PyInstaller_.
+
+ Suppose that Python installed to ``C:\\Program Files\\Python35-32``
+
+ Make ``python.exe`` accessible via PATH environment variable or cd to directory containing python.exe.
+
+ ::
+
+ python -m pip install pyinstaller
+
+ This command will install ``PyInstaller`` package and its dependencies.
+
+4. Build ``transifex-client`` distribution.
+
+ Change directory to transifex-client folder and run command:
+
+ ::
+
+ python -m PyInstaller contrib/tx.spec
+ # or
+ pyinstaller contrib/tx.spec
+
+5. ``tx.exe``
+
+ ``dist/tx.exe`` will be created as the result of build process.
+
-.. _in-development version: http://github.com/transifex/transifex-client/tarball/master#egg=transifex-client-dev
+.. _Python: https://www.python.org/downloads/windows/
+.. _PyInstaller: http://www.pyinstaller.org
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 0000000..ce36fb6
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,76 @@
+environment:
+ global:
+ # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the
+ # /E:ON and /V:ON options are not enabled in the batch script intepreter
+ # See: http://stackoverflow.com/a/13751649/163740
+ CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\appveyor\\run_with_env.cmd"
+
+ matrix:
+
+ - PYTHON: "C:\\Python27"
+ PYTHON_VERSION: "2.7.x"
+ PYTHON_ARCH: "32"
+
+ - PYTHON: "C:\\Python27-x64"
+ PYTHON_VERSION: "2.7.x"
+ PYTHON_ARCH: "64"
+
+ - PYTHON: "C:\\Python35"
+ PYTHON_VERSION: "3.5.x"
+ PYTHON_ARCH: "32"
+
+ - PYTHON: "C:\\Python35-x64"
+ PYTHON_VERSION: "3.5.x"
+ PYTHON_ARCH: "64"
+
+
+install:
+ - ECHO "Filesystem root:"
+ - ps: "ls \"C:/\""
+
+ # Prepend newly installed Python to the PATH of this build (this cannot be
+ # done from inside the powershell script as it would require to restart
+ # the parent CMD process).
+ - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
+
+ # Check that we have the expected version and architecture for Python
+ - "python --version"
+ - "python -c \"import struct; print(struct.calcsize('P') * 8)\""
+
+ # Upgrade to the latest version of pip to avoid it displaying warnings
+ # about it being out of date.
+ - "pip install --disable-pip-version-check --user --upgrade pip"
+ - "pip install pyinstaller"
+
+ # Install the build dependencies of the project. If some dependencies contain
+ # compiled extensions and are not provided as pre-built wheel packages,
+ # pip will build them from source using the MSVC compiler matching the
+ # target Python version and architecture
+ #- "%CMD_IN_ENV% pip install -r dev-requirements.txt"
+ - pip install -r requirements.txt
+
+build_script:
+ # Build the compiled extension
+ #- "%CMD_IN_ENV% python setup.py build"
+ - pyinstaller contrib/tx.spec
+
+test_script:
+ # Run the project tests
+ #- "%CMD_IN_ENV% python setup.py nosetests"
+ - bash contrib/test_win_build.sh
+
+after_test:
+ # If tests are successful, create binary packages for the project.
+ #- "%CMD_IN_ENV% python setup.py bdist_wheel"
+ #- "%CMD_IN_ENV% python setup.py bdist_wininst"
+ #- "%CMD_IN_ENV% python setup.py bdist_msi"
+ - ps: "ls dist"
+
+artifacts:
+ # Archive the generated packages in the ci.appveyor.com build report.
+ - path: dist\*
+
+#on_success:
+# - TODO: upload the content of dist/*.whl to a public wheelhouse
+#
+
diff --git a/circle.yml b/circle.yml
new file mode 100644
index 0000000..adda24e
--- /dev/null
+++ b/circle.yml
@@ -0,0 +1,17 @@
+machine:
+ environment:
+ TOX_PY27: '2.7.10'
+ TOX_PY35: '3.5.0'
+
+dependencies:
+ override:
+ - pip -V
+ - pip install -U pip
+ - pip install -U ipdb
+ - pip install -U tox
+ - pip install -U tox-pyenv
+ - pyenv local $TOX_PY27 $TOX_PY35
+
+test:
+ override:
+ - tox -v --recreate
diff --git a/contrib/test_build.sh b/contrib/test_build.sh
new file mode 100755
index 0000000..930ef33
--- /dev/null
+++ b/contrib/test_build.sh
@@ -0,0 +1,5 @@
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+BRANCH="linux_osx"
+TX=`which tx`
+echo $TX
+source "$DIR/tx_commands.sh"
diff --git a/contrib/test_win_build.sh b/contrib/test_win_build.sh
new file mode 100644
index 0000000..2464a0c
--- /dev/null
+++ b/contrib/test_win_build.sh
@@ -0,0 +1,4 @@
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+BRANCH="win-${PYTHON//C:\\/}"
+TX="$DIR/../dist/tx.exe"
+source "$DIR/tx_commands.sh"
diff --git a/contrib/tx.ico b/contrib/tx.ico
new file mode 100644
index 0000000..ade1963
Binary files /dev/null and b/contrib/tx.ico differ
diff --git a/contrib/tx.spec b/contrib/tx.spec
new file mode 100644
index 0000000..3febf6d
--- /dev/null
+++ b/contrib/tx.spec
@@ -0,0 +1,29 @@
+# -*- mode: python -*-
+
+block_cipher = None
+added_files = [
+ ('../txclib/cacert.pem', 'txclib'),
+]
+
+a = Analysis(['../tx'],
+ binaries=None,
+ datas=added_files,
+ hiddenimports=[],
+ hookspath=None,
+ runtime_hooks=None,
+ excludes=None,
+ win_no_prefer_redirects=None,
+ win_private_assemblies=None,
+ cipher=block_cipher)
+pyz = PYZ(a.pure, a.zipped_data,
+ cipher=block_cipher)
+exe = EXE(pyz,
+ a.scripts,
+ a.binaries,
+ a.zipfiles,
+ a.datas,
+ name='tx',
+ debug=False,
+ strip=None,
+ upx=False,
+ console=True , icon='contrib/tx.ico')
diff --git a/contrib/tx_commands.sh b/contrib/tx_commands.sh
new file mode 100644
index 0000000..95f6372
--- /dev/null
+++ b/contrib/tx_commands.sh
@@ -0,0 +1,12 @@
+# Exit on fail
+set -e
+
+rm -rf txci
+git clone https://github.com/diegobz/txci.git
+cd txci
+rm -rf .tx
+$TX init --host="https://www.transifex.com" --user=$TRANSIFEX_USER --pass=$TRANSIFEX_PASSWORD
+$TX set --auto-local -r txci.$BRANCH -s en 'locale/<lang>/LC_MESSAGES/django.po' -t PO --execute
+$TX --traceback push -s
+$TX --traceback pull -l pt_BR -f
+$TX --traceback delete -f
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..a42590b
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+urllib3
diff --git a/setup.cfg b/setup.cfg
deleted file mode 100644
index 861a9f5..0000000
--- a/setup.cfg
+++ /dev/null
@@ -1,5 +0,0 @@
-[egg_info]
-tag_build =
-tag_date = 0
-tag_svn_revision = 0
-
diff --git a/setup.py b/setup.py
index d7bec14..6ccf510 100755
--- a/setup.py
+++ b/setup.py
@@ -1,73 +1,35 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-import os.path
-import io
+from codecs import open
from setuptools import setup
-from txclib import get_version
+import txclib
-readme_file = io.open('README.rst', 'rt', encoding='UTF-8')
-long_description = readme_file.read()
-readme_file.close()
-package_data = {
- '': ['LICENSE', 'README.rst'],
- 'txclib': ['*.pem'],
-}
-
-scripts = ['tx']
-
-install_requires = []
-extra_args = {}
-import platform
-if platform.system() == 'Windows':
- from py2exe.build_exe import py2exe as build_exe
-
- class MediaCollector(build_exe):
- # See http://crazedmonkey.com/blog/python/pkg_resources-with-py2exe.html
- def copy_extensions(self, extensions):
- build_exe.copy_extensions(self, extensions)
- self.copy_file(
- 'txclib/cacert.pem',
- os.path.join(self.collect_dir, 'txclib/cacert.pem')
- )
- self.compiled_files.append('txclib/cacert.pem')
-
- extra_args = {
- 'console': ['tx'],
- 'options': {'py2exe': {'bundle_files': 1}},
- 'zipfile': None,
- 'cmdclass': {'py2exe': MediaCollector},
- }
+def get_file_content(filename):
+ with open(filename, 'r', encoding='UTF-8') as f:
+ return f.read()
setup(
name="transifex-client",
- version=get_version(),
- scripts=scripts,
+ version=txclib.__version__,
+ scripts=['tx'],
description="A command line interface for Transifex",
- long_description=long_description,
+ long_description=get_file_content('README.rst'),
author="Transifex",
author_email="admin at transifex.com",
url="https://www.transifex.com",
license="GPLv2",
- dependency_links=[
- ],
- setup_requires=[
- ],
- install_requires=install_requires,
- tests_require=["mock", ],
- data_files=[
- ],
+ dependency_links=[],
+ setup_requires=[],
+ install_requires=get_file_content('requirements.txt').splitlines(),
+ tests_require=["mock"],
+ data_files=[],
test_suite="tests",
zip_safe=False,
- packages=[
- 'txclib', 'txclib.packages', 'txclib.packages.urllib3',
- 'txclib.packages.urllib3.contrib',
- 'txclib.packages.urllib3.packages',
- 'txclib.packages.urllib3.packages.ssl_match_hostname',
- ],
+ packages=['txclib'],
include_package_data=True,
- package_data=package_data,
+ package_data={},
keywords=('translation', 'localization', 'internationalization',),
classifiers=[
'Programming Language :: Python',
@@ -75,6 +37,6 @@ setup(
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.5',
],
- **extra_args
)
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..353951f
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,12 @@
+[tox]
+envlist = py27,py35
+
+[testenv]
+whitelist_externals = source
+ bash
+install_command = pip install -U {opts} {packages}
+setenv = TOX_ENV_NAME={envname}
+passenv = TOX_* TRANSIFEX_USER TRANSIFEX_PASSWORD
+commands = python -V
+ python setup.py test
+ bash ./contrib/test_build.sh
diff --git a/transifex_client.egg-info/PKG-INFO b/transifex_client.egg-info/PKG-INFO
deleted file mode 100644
index e00ad75..0000000
--- a/transifex_client.egg-info/PKG-INFO
+++ /dev/null
@@ -1,45 +0,0 @@
-Metadata-Version: 1.1
-Name: transifex-client
-Version: 0.11.1.beta
-Summary: A command line interface for Transifex
-Home-page: https://www.transifex.com
-Author: Transifex
-Author-email: admin at transifex.com
-License: GPLv2
-Description:
- =============================
- Transifex Command-Line Tool
- =============================
-
- The Transifex Command-line Client is a command line tool that enables
- you to easily manage your translations within a project without the need
- of an elaborate UI system.
-
- You can use the command line client to easily create new resources, map
- locale files to translations and synchronize your Transifex project with
- your local repository and vice verca. Translators and localization
- managers can also use it to handle large volumes of translation files
- easily and without much hassle.
-
- Check the full documentation at
- http://support.transifex.com/customer/portal/topics/440187-transifex-client/articles.
-
-
- Installing
- ==========
-
- You can install the latest version of transifex-client running ``pip
- install transifex-client`` or ``easy_install transifex-client``
- You can also install the `in-development version`_ of transifex-client
- with ``pip install transifex-client==dev`` or ``easy_install
- transifex-client==dev``.
-
- .. _in-development version: http://github.com/transifex/transifex-client/tarball/master#egg=transifex-client-dev
-
-Keywords: translation,localization,internationalization
-Platform: UNKNOWN
-Classifier: Programming Language :: Python
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.6
-Classifier: Programming Language :: Python :: 2.7
-Classifier: Programming Language :: Python :: 3.3
diff --git a/transifex_client.egg-info/SOURCES.txt b/transifex_client.egg-info/SOURCES.txt
deleted file mode 100644
index f1471d1..0000000
--- a/transifex_client.egg-info/SOURCES.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-LICENSE
-MANIFEST.in
-README.rst
-setup.py
-tx
-tests/__init__.py
-tests/test_paths.py
-tests/test_processors.py
-tests/test_project.py
-transifex_client.egg-info/PKG-INFO
-transifex_client.egg-info/SOURCES.txt
-transifex_client.egg-info/dependency_links.txt
-transifex_client.egg-info/not-zip-safe
-transifex_client.egg-info/top_level.txt
-txclib/__init__.py
-txclib/cacert.pem
-txclib/commands.py
-txclib/config.py
-txclib/exceptions.py
-txclib/log.py
-txclib/parsers.py
-txclib/paths.py
-txclib/processors.py
-txclib/project.py
-txclib/urls.py
-txclib/utils.py
-txclib/web.py
-txclib/packages/__init__.py
-txclib/packages/urllib3/__init__.py
-txclib/packages/urllib3/_collections.py
-txclib/packages/urllib3/connectionpool.py
-txclib/packages/urllib3/exceptions.py
-txclib/packages/urllib3/fields.py
-txclib/packages/urllib3/filepost.py
-txclib/packages/urllib3/poolmanager.py
-txclib/packages/urllib3/request.py
-txclib/packages/urllib3/response.py
-txclib/packages/urllib3/util.py
-txclib/packages/urllib3/contrib/__init__.py
-txclib/packages/urllib3/contrib/ntlmpool.py
-txclib/packages/urllib3/contrib/pyopenssl.py
-txclib/packages/urllib3/packages/__init__.py
-txclib/packages/urllib3/packages/ordered_dict.py
-txclib/packages/urllib3/packages/six.py
-txclib/packages/urllib3/packages/ssl_match_hostname/__init__.py
\ No newline at end of file
diff --git a/transifex_client.egg-info/dependency_links.txt b/transifex_client.egg-info/dependency_links.txt
deleted file mode 100644
index 8b13789..0000000
--- a/transifex_client.egg-info/dependency_links.txt
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/transifex_client.egg-info/not-zip-safe b/transifex_client.egg-info/not-zip-safe
deleted file mode 100644
index 8b13789..0000000
--- a/transifex_client.egg-info/not-zip-safe
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/transifex_client.egg-info/top_level.txt b/transifex_client.egg-info/top_level.txt
deleted file mode 100644
index 5561019..0000000
--- a/transifex_client.egg-info/top_level.txt
+++ /dev/null
@@ -1 +0,0 @@
-txclib
diff --git a/tx b/tx
index bbcc21a..096bdca 100755
--- a/tx
+++ b/tx
@@ -1,14 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-from optparse import OptionParser, OptionValueError
import os
import sys
-import errno
+from optparse import OptionParser
+from urllib3.exceptions import SSLError
+
+import txclib
from txclib import utils
-from txclib import get_version
from txclib.log import set_log_level, logger
-from txclib.packages.urllib3.exceptions import SSLError
# This block ensures that ^C interrupts are handled quietly.
@@ -49,7 +49,7 @@ def main(argv):
" command`"
parser = OptionParser(
- usage=usage, version=get_version(), description=description
+ usage=usage, version=txclib.__version__, description=description
)
parser.disable_interspersed_args()
parser.add_option(
diff --git a/txclib/__init__.py b/txclib/__init__.py
index 5a87c84..7926bec 100644
--- a/txclib/__init__.py
+++ b/txclib/__init__.py
@@ -1,12 +1,4 @@
# -*- coding: utf-8 -*-
-VERSION = (0, 11, 1, 'beta')
-
-
-def get_version():
- version = '%s.%s' % (VERSION[0], VERSION[1])
- if VERSION[2]:
- version = '%s.%s' % (version, VERSION[2])
- if VERSION[3] != 'final':
- version = '%s %s' % (version, VERSION[3])
- return version
+# https://www.python.org/dev/peps/pep-0440/#examples-of-compliant-version-schemes
+__version__ = '0.11'
diff --git a/txclib/commands.py b/txclib/commands.py
index e1b97ac..8ad3954 100644
--- a/txclib/commands.py
+++ b/txclib/commands.py
@@ -25,6 +25,7 @@ try:
except ImportError:
import ConfigParser as configparser
+from urllib3.packages.six.moves import input
from txclib import utils, project
from txclib.utils import parse_json, compile_json, files_in_project
@@ -34,7 +35,6 @@ from txclib.parsers import delete_parser, help_parser, parse_csv_option, \
status_parser, pull_parser, set_parser, push_parser, init_parser
from txclib.paths import posix_path
from txclib.log import logger
-from txclib.packages.urllib3.packages.six.moves import input
def cmd_init(argv, path_to_tx):
diff --git a/txclib/config.py b/txclib/config.py
index 0b32120..a94fb5c 100644
--- a/txclib/config.py
+++ b/txclib/config.py
@@ -3,7 +3,7 @@ try:
except ImportError:
import ConfigParser as configparser
-from txclib.packages.urllib3.packages import six
+from urllib3.packages import six
class OrderedRawConfigParser(configparser.RawConfigParser):
diff --git a/txclib/log.py b/txclib/log.py
index e06f9fc..fe241ac 100644
--- a/txclib/log.py
+++ b/txclib/log.py
@@ -7,7 +7,7 @@ Add logging capabilities to tx-client.
import sys
import logging
-_logger = logging.getLogger('txclib.packages.urllib3')
+_logger = logging.getLogger('urllib3')
_logger.setLevel(logging.CRITICAL)
_logger = logging.getLogger('txclib')
diff --git a/txclib/packages/__init__.py b/txclib/packages/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/txclib/packages/urllib3/__init__.py b/txclib/packages/urllib3/__init__.py
deleted file mode 100644
index eed7006..0000000
--- a/txclib/packages/urllib3/__init__.py
+++ /dev/null
@@ -1,58 +0,0 @@
-# urllib3/__init__.py
-# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
-#
-# This module is part of urllib3 and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-
-"""
-urllib3 - Thread-safe connection pooling and re-using.
-"""
-
-__author__ = 'Andrey Petrov (andrey.petrov at shazow.net)'
-__license__ = 'MIT'
-__version__ = '1.7.1'
-
-
-from .connectionpool import (
- HTTPConnectionPool,
- HTTPSConnectionPool,
- connection_from_url
-)
-
-from . import exceptions
-from .filepost import encode_multipart_formdata
-from .poolmanager import PoolManager, ProxyManager, proxy_from_url
-from .response import HTTPResponse
-from .util import make_headers, get_host, Timeout
-
-
-# Set default logging handler to avoid "No handler found" warnings.
-import logging
-try: # Python 2.7+
- from logging import NullHandler
-except ImportError:
- class NullHandler(logging.Handler):
- def emit(self, record):
- pass
-
-logging.getLogger(__name__).addHandler(NullHandler())
-
-def add_stderr_logger(level=logging.DEBUG):
- """
- Helper for quickly adding a StreamHandler to the logger. Useful for
- debugging.
-
- Returns the handler after adding it.
- """
- # This method needs to be in this __init__.py to get the __name__ correct
- # even if urllib3 is vendored within another package.
- logger = logging.getLogger(__name__)
- handler = logging.StreamHandler()
- handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s'))
- logger.addHandler(handler)
- logger.setLevel(level)
- logger.debug('Added an stderr logging handler to logger: %s' % __name__)
- return handler
-
-# ... Clean up.
-del NullHandler
diff --git a/txclib/packages/urllib3/_collections.py b/txclib/packages/urllib3/_collections.py
deleted file mode 100644
index 282b8d5..0000000
--- a/txclib/packages/urllib3/_collections.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# urllib3/_collections.py
-# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
-#
-# This module is part of urllib3 and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-
-from collections import MutableMapping
-from threading import RLock
-
-try: # Python 2.7+
- from collections import OrderedDict
-except ImportError:
- from .packages.ordered_dict import OrderedDict
-
-
-__all__ = ['RecentlyUsedContainer']
-
-
-_Null = object()
-
-
-class RecentlyUsedContainer(MutableMapping):
- """
- Provides a thread-safe dict-like container which maintains up to
- ``maxsize`` keys while throwing away the least-recently-used keys beyond
- ``maxsize``.
-
- :param maxsize:
- Maximum number of recent elements to retain.
-
- :param dispose_func:
- Every time an item is evicted from the container,
- ``dispose_func(value)`` is called. Callback which will get called
- """
-
- ContainerCls = OrderedDict
-
- def __init__(self, maxsize=10, dispose_func=None):
- self._maxsize = maxsize
- self.dispose_func = dispose_func
-
- self._container = self.ContainerCls()
- self.lock = RLock()
-
- def __getitem__(self, key):
- # Re-insert the item, moving it to the end of the eviction line.
- with self.lock:
- item = self._container.pop(key)
- self._container[key] = item
- return item
-
- def __setitem__(self, key, value):
- evicted_value = _Null
- with self.lock:
- # Possibly evict the existing value of 'key'
- evicted_value = self._container.get(key, _Null)
- self._container[key] = value
-
- # If we didn't evict an existing value, we might have to evict the
- # least recently used item from the beginning of the container.
- if len(self._container) > self._maxsize:
- _key, evicted_value = self._container.popitem(last=False)
-
- if self.dispose_func and evicted_value is not _Null:
- self.dispose_func(evicted_value)
-
- def __delitem__(self, key):
- with self.lock:
- value = self._container.pop(key)
-
- if self.dispose_func:
- self.dispose_func(value)
-
- def __len__(self):
- with self.lock:
- return len(self._container)
-
- def __iter__(self):
- raise NotImplementedError('Iteration over this class is unlikely to be threadsafe.')
-
- def clear(self):
- with self.lock:
- # Copy pointers to all values, then wipe the mapping
- # under Python 2, this copies the list of values twice :-|
- values = list(self._container.values())
- self._container.clear()
-
- if self.dispose_func:
- for value in values:
- self.dispose_func(value)
-
- def keys(self):
- with self.lock:
- return self._container.keys()
diff --git a/txclib/packages/urllib3/connectionpool.py b/txclib/packages/urllib3/connectionpool.py
deleted file mode 100644
index 691d4e2..0000000
--- a/txclib/packages/urllib3/connectionpool.py
+++ /dev/null
@@ -1,745 +0,0 @@
-# urllib3/connectionpool.py
-# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
-#
-# This module is part of urllib3 and is released under
-# the MIT License: http://www.opensource.org/licenses/mit-license.php
-
-import errno
-import logging
-
-from socket import error as SocketError, timeout as SocketTimeout
-import socket
-
-try: # Python 3
- from http.client import HTTPConnection, HTTPException
- from http.client import HTTP_PORT, HTTPS_PORT
-except ImportError:
- from httplib import HTTPConnection, HTTPException
- from httplib import HTTP_PORT, HTTPS_PORT
-
-try: # Python 3
- from queue import LifoQueue, Empty, Full
-except ImportError:
- from Queue import LifoQueue, Empty, Full
- import Queue as _ # Platform-specific: Windows
-
-
-try: # Compiled with SSL?
- HTTPSConnection = object
-
- class BaseSSLError(BaseException):
- pass
-
- ssl = None
-
- try: # Python 3
- from http.client import HTTPSConnection
- except ImportError:
- from httplib import HTTPSConnection
-
- import ssl
- BaseSSLError = ssl.SSLError
-
-except (ImportError, AttributeError): # Platform-specific: No SSL.
- pass
-
-
-from .exceptions import (
- ClosedPoolError,
- ConnectTimeoutError,
- EmptyPoolError,
- HostChangedError,
- MaxRetryError,
... 3938 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/transifex-client.git
More information about the Python-modules-commits
mailing list