Commit d154ee86 authored by Cédric Bonhomme's avatar Cédric Bonhomme

Indent of two spaces.

parent 900a6370
...@@ -47,15 +47,15 @@ import sys ...@@ -47,15 +47,15 @@ import sys
from primo.linking.fetch_data import FetchData from primo.linking.fetch_data import FetchData
if __name__ == "__main__": if __name__ == "__main__":
# Point of entry in execution mode # Point of entry in execution mode
file_path = sys.argv[1:] file_path = sys.argv[1:]
apps, components, intents, intent_filters = FetchData(file_path, "", True) apps, components, intents, intent_filters = FetchData(file_path, "", True)
print("") print("")
for app in apps: for app in apps:
print(app.name) print(app.name)
print("""\tSends external intent: {} print("""\tSends external intent: {}
Has publicly accessible component: {}""". \ Has publicly accessible component: {}""". \
format(app.SendsExternalIntent(), format(app.SendsExternalIntent(),
app.HasOpenComponent())) app.HasOpenComponent()))
``` ```
...@@ -26,34 +26,34 @@ SRC_DIR = 'primo/linking' ...@@ -26,34 +26,34 @@ SRC_DIR = 'primo/linking'
if glob.glob(os.path.join(SRC_DIR, '*.c')): if glob.glob(os.path.join(SRC_DIR, '*.c')):
use_cython = False use_cython = False
elif glob.glob(os.path.join(SRC_DIR, '*.pyx')): elif glob.glob(os.path.join(SRC_DIR, '*.pyx')):
try: try:
from Cython.Distutils import build_ext from Cython.Distutils import build_ext
use_cython = True use_cython = True
#from Cython.Compiler import Options #from Cython.Compiler import Options
#Options.annotate = True #Options.annotate = True
# Options.directive_defaults['profile'] = True # Options.directive_defaults['profile'] = True
except ImportError: except ImportError:
use_cython = False
else:
# We don't ship .pyx files with a source distribution so that users don't have
# to cythonize everything again.
# See http://docs.cython.org/src/reference/compilation.html#distributing-cython-modules.
use_cython = False use_cython = False
else:
# We don't ship .pyx files with a source distribution so that users don't have
# to cythonize everything again.
# See http://docs.cython.org/src/reference/compilation.html#distributing-cython-modules.
use_cython = False
def ScanDir(directory, file_extension, files=[]): def ScanDir(directory, file_extension, files=[]):
"""Scans the 'linking' directory for extension files, converting """Scans the 'linking' directory for extension files, converting
them to extension names in dotted notation.""" them to extension names in dotted notation."""
for file_name in os.listdir(directory): for file_name in os.listdir(directory):
file_path = os.path.join(directory, file_name) file_path = os.path.join(directory, file_name)
if os.path.isfile(file_path) and file_path.endswith(file_extension): if os.path.isfile(file_path) and file_path.endswith(file_extension):
files.append(file_path.replace(os.path.sep, '.')[:-len(file_extension)]) files.append(file_path.replace(os.path.sep, '.')[:-len(file_extension)])
elif os.path.isdir(file_path): elif os.path.isdir(file_path):
ScanDir(file_path, file_extension, files) ScanDir(file_path, file_extension, files)
return files return files
NAME = 'primo' NAME = 'primo'
VERSION = '0.1.0' VERSION = '0.1.0'
...@@ -67,47 +67,47 @@ LICENSE = 'Apache 2.0' ...@@ -67,47 +67,47 @@ LICENSE = 'Apache 2.0'
PACKAGES = ['primo', 'primo.linking'] PACKAGES = ['primo', 'primo.linking']
SCRIPTS = ['bin/primo', 'bin/make_plots_and_stats', SCRIPTS = ['bin/primo', 'bin/make_plots_and_stats',
'bin/performance_experiments'] 'bin/performance_experiments']
CMD_CLASS = {} CMD_CLASS = {}
OPTIONS = {} OPTIONS = {}
def MakeExtension(ext_name, file_extension): def MakeExtension(ext_name, file_extension):
"""Generates an Extension object from its dotted name.""" """Generates an Extension object from its dotted name."""
ext_path = ext_name.replace(".", os.path.sep) + file_extension ext_path = ext_name.replace(".", os.path.sep) + file_extension
return Extension( return Extension(
ext_name, ext_name,
[ext_path], [ext_path],
include_dirs = ['.', numpy.get_include()], include_dirs = ['.', numpy.get_include()],
extra_compile_args = ['-O3', '-Wall'], extra_compile_args = ['-O3', '-Wall'],
extra_link_args = ['-g'], extra_link_args = ['-g'],
) )
if __name__ == "__main__": if __name__ == "__main__":
if use_cython: if use_cython:
extension = '.pyx' extension = '.pyx'
CMD_CLASS['build_ext'] = build_ext CMD_CLASS['build_ext'] = build_ext
OPTIONS['build_ext'] = {'inplace':True} OPTIONS['build_ext'] = {'inplace':True}
else: else:
extension = '.c' extension = '.c'
# Get the list of extensions. # Get the list of extensions.
ext_names = ScanDir('primo', extension) ext_names = ScanDir('primo', extension)
# And build up the set of Extension objects. # And build up the set of Extension objects.
extensions = [MakeExtension(name, extension) for name in ext_names] extensions = [MakeExtension(name, extension) for name in ext_names]
setup(packages=PACKAGES, setup(packages=PACKAGES,
name=NAME, name=NAME,
version=VERSION, version=VERSION,
description=DESCR, description=DESCR,
author=AUTHOR, author=AUTHOR,
author_email=EMAIL, author_email=EMAIL,
url=URL, url=URL,
scripts=SCRIPTS, scripts=SCRIPTS,
license=LICENSE, license=LICENSE,
cmdclass=CMD_CLASS, cmdclass=CMD_CLASS,
ext_modules=extensions, ext_modules=extensions,
options=OPTIONS options=OPTIONS
) )
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment