[vlc-commits] Fix packaging

Olivier Aubert git at videolan.org
Tue Nov 24 17:01:14 CET 2015


vlc/python | branch: master | Olivier Aubert <contact at olivieraubert.net> | Fri Nov  6 00:16:24 2015 +0100| [c1235908767573fb6629fb4e0b338bb4c41973af] | committer: Olivier Aubert

Fix packaging

> http://git.videolan.org/gitweb.cgi/vlc/python.git/?a=commit;h=c1235908767573fb6629fb4e0b338bb4c41973af
---

 MANIFEST.in           |    6 ++++++
 generator/__init__.py |    1 +
 generator/generate.py |   17 +++++++++++++----
 setup.py              |    8 +++-----
 4 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..4e43162
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,6 @@
+include setup.py
+include COPYING COPYING.generator MANIFEST.in README.rst TODO
+include distribute_setup.py Makefile 
+recursive-include generator *
+recursive-include tests *
+recursive-include examples *
diff --git a/generator/__init__.py b/generator/__init__.py
new file mode 100644
index 0000000..012842b
--- /dev/null
+++ b/generator/__init__.py
@@ -0,0 +1 @@
+# Generator package
diff --git a/generator/generate.py b/generator/generate.py
index 38f111c..b556ac1 100755
--- a/generator/generate.py
+++ b/generator/generate.py
@@ -51,7 +51,7 @@ C{LibVlc-footer.java} and C{LibVlc-header.java}.
 __all__     = ('Parser',
                'PythonGenerator', 'JavaGenerator',
                'process')
-__version__ =  '20.12.04.27'
+__version__ =  '20.15.11.06'
 
 _debug = False
 
@@ -61,15 +61,24 @@ import re
 import time
 import operator
 
-BASEDIR = os.path.abspath(os.path.dirname(sys.argv[0]))
+BASEDIR = os.path.abspath(os.path.dirname(__file__))
 
-# Opener for text files
-if sys.hexversion < 0x3000000:
+if sys.version_info[0] < 3:
+    PYTHON3 = False
     def opener(name, mode='r'):
         return open(name, mode)
+    str = str
+    unicode = unicode
+    bytes = str
+    basestring = basestring
 else:  # Python 3+
+    PYTHON3 = True
     def opener(name, mode='r'):  #PYCHOK expected
         return open(name, mode, encoding='utf8')
+    str = str
+    unicode = str
+    bytes = bytes
+    basestring = (str, bytes)
 
 # Functions not wrapped/not referenced
 _blacklist = {
diff --git a/setup.py b/setup.py
index ef96cd7..00732e9 100644
--- a/setup.py
+++ b/setup.py
@@ -4,15 +4,13 @@ use_setuptools()
 import logging
 import os
 import shutil
-from distutils.core import setup
-
-import generate
-
+from setuptools import setup
 
 vlc_include_path = os.path.join("..", "..", "include", "vlc")
 if os.path.exists(vlc_include_path):
     files = [ os.path.join(vlc_include_path, filename)
               for filename in os.listdir(vlc_include_path) ]
+    from generator import generate
     generate.process('vlc.py', files)
 else:
     logging.warning("This script should be run from a VLC tree. "
@@ -20,7 +18,7 @@ else:
     shutil.copy(os.path.join('generated', 'vlc.py'), 'vlc.py')
 
 setup(name='python-vlc',
-      version = '1.1.1',
+      version = '1.1.2',
       author='Olivier Aubert',
       author_email='contact at olivieraubert.net',
       maintainer='Olivier Aubert',



More information about the vlc-commits mailing list