Fix compilation for Python 3
This commit is contained in:
parent
f789ed4ee5
commit
abef078c58
2
comfortable_swipe/__main__.py → scripts/comfortable-swipe
Normal file → Executable file
2
comfortable_swipe/__main__.py → scripts/comfortable-swipe
Normal file → Executable file
@ -1,5 +1,3 @@
|
|||||||
from __future__ import print_function
|
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from comfortable_swipe import service
|
from comfortable_swipe import service
|
||||||
|
|
||||||
12
setup.py
12
setup.py
@ -1,7 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
from setuptools.extension import Extension
|
from setuptools.extension import Extension
|
||||||
|
|
||||||
|
__BIN__ = os.path.dirname(sys.executable)
|
||||||
|
_SHARE_ = os.path.join(os.path.dirname(__BIN__), 'share')
|
||||||
__CWD__ = os.getcwd()
|
__CWD__ = os.getcwd()
|
||||||
__DIR__ = os.path.abspath(os.path.dirname(__file__))
|
__DIR__ = os.path.abspath(os.path.dirname(__file__))
|
||||||
__URL__ = 'https://github.com/Hikari9/comfortable-swipe-ubuntu'
|
__URL__ = 'https://github.com/Hikari9/comfortable-swipe-ubuntu'
|
||||||
@ -9,8 +12,8 @@ __URL__ = 'https://github.com/Hikari9/comfortable-swipe-ubuntu'
|
|||||||
NAME = 'comfortable-swipe'
|
NAME = 'comfortable-swipe'
|
||||||
PYTHON_NAME = NAME.replace('-', '_')
|
PYTHON_NAME = NAME.replace('-', '_')
|
||||||
VERSION = '1.1.0'
|
VERSION = '1.1.0'
|
||||||
PROGRAM = os.path.join('/usr/local/bin', NAME)
|
PROGRAM = os.path.join(__BIN__, NAME)
|
||||||
CONFIG = os.path.join('/usr/local/share', NAME, NAME + '.conf')
|
CONFIG = os.path.join(_SHARE_, NAME, NAME + '.conf')
|
||||||
|
|
||||||
# for C++ library
|
# for C++ library
|
||||||
cpp_macros = dict(
|
cpp_macros = dict(
|
||||||
@ -23,6 +26,10 @@ try:
|
|||||||
# make sure working directory is here
|
# make sure working directory is here
|
||||||
os.chdir(__DIR__)
|
os.chdir(__DIR__)
|
||||||
|
|
||||||
|
# make sure paths to program and config exist
|
||||||
|
os.makedirs(os.path.dirname(PROGRAM), exist_ok=True)
|
||||||
|
os.makedirs(os.path.dirname(CONFIG), exist_ok=True)
|
||||||
|
|
||||||
# save README as long_description
|
# save README as long_description
|
||||||
with open('README.md', 'r') as README_file:
|
with open('README.md', 'r') as README_file:
|
||||||
README = README_file.read()
|
README = README_file.read()
|
||||||
@ -52,6 +59,7 @@ try:
|
|||||||
author_email='thericotiongson@gmail.com',
|
author_email='thericotiongson@gmail.com',
|
||||||
url=__URL__,
|
url=__URL__,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
|
scripts=['scripts/comfortable-swipe'],
|
||||||
ext_modules=extensions
|
ext_modules=extensions
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user