Indent of two spaces.

parent 900a6370
......@@ -47,15 +47,15 @@ import sys
from primo.linking.fetch_data import FetchData
if __name__ == "__main__":
# Point of entry in execution mode
file_path = sys.argv[1:]
apps, components, intents, intent_filters = FetchData(file_path, "", True)
print("")
for app in apps:
print(app.name)
print("""\tSends external intent: {}
Has publicly accessible component: {}""". \
format(app.SendsExternalIntent(),
app.HasOpenComponent()))
# Point of entry in execution mode
file_path = sys.argv[1:]
apps, components, intents, intent_filters = FetchData(file_path, "", True)
print("")
for app in apps:
print(app.name)
print("""\tSends external intent: {}
Has publicly accessible component: {}""". \
format(app.SendsExternalIntent(),
app.HasOpenComponent()))
```
......@@ -26,34 +26,34 @@ SRC_DIR = 'primo/linking'
if glob.glob(os.path.join(SRC_DIR, '*.c')):
use_cython = False
use_cython = False
elif glob.glob(os.path.join(SRC_DIR, '*.pyx')):
try:
from Cython.Distutils import build_ext
use_cython = True
#from Cython.Compiler import Options
#Options.annotate = True
# Options.directive_defaults['profile'] = True
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.
try:
from Cython.Distutils import build_ext
use_cython = True
#from Cython.Compiler import Options
#Options.annotate = True
# Options.directive_defaults['profile'] = True
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
def ScanDir(directory, file_extension, files=[]):
"""Scans the 'linking' directory for extension files, converting
them to extension names in dotted notation."""
"""Scans the 'linking' directory for extension files, converting
them to extension names in dotted notation."""
for file_name in os.listdir(directory):
file_path = os.path.join(directory, file_name)
if os.path.isfile(file_path) and file_path.endswith(file_extension):
files.append(file_path.replace(os.path.sep, '.')[:-len(file_extension)])
elif os.path.isdir(file_path):
ScanDir(file_path, file_extension, files)
return files
for file_name in os.listdir(directory):
file_path = os.path.join(directory, file_name)
if os.path.isfile(file_path) and file_path.endswith(file_extension):
files.append(file_path.replace(os.path.sep, '.')[:-len(file_extension)])
elif os.path.isdir(file_path):
ScanDir(file_path, file_extension, files)
return files
NAME = 'primo'
VERSION = '0.1.0'
......@@ -67,47 +67,47 @@ LICENSE = 'Apache 2.0'
PACKAGES = ['primo', 'primo.linking']
SCRIPTS = ['bin/primo', 'bin/make_plots_and_stats',
'bin/performance_experiments']
'bin/performance_experiments']
CMD_CLASS = {}
OPTIONS = {}
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
return Extension(
ext_name,
[ext_path],
include_dirs = ['.', numpy.get_include()],
extra_compile_args = ['-O3', '-Wall'],
extra_link_args = ['-g'],
)
ext_path = ext_name.replace(".", os.path.sep) + file_extension
return Extension(
ext_name,
[ext_path],
include_dirs = ['.', numpy.get_include()],
extra_compile_args = ['-O3', '-Wall'],
extra_link_args = ['-g'],
)
if __name__ == "__main__":
if use_cython:
extension = '.pyx'
CMD_CLASS['build_ext'] = build_ext
OPTIONS['build_ext'] = {'inplace':True}
else:
extension = '.c'
# Get the list of extensions.
ext_names = ScanDir('primo', extension)
# And build up the set of Extension objects.
extensions = [MakeExtension(name, extension) for name in ext_names]
setup(packages=PACKAGES,
name=NAME,
version=VERSION,
description=DESCR,
author=AUTHOR,
author_email=EMAIL,
url=URL,
scripts=SCRIPTS,
license=LICENSE,
cmdclass=CMD_CLASS,
ext_modules=extensions,
options=OPTIONS
)
if use_cython:
extension = '.pyx'
CMD_CLASS['build_ext'] = build_ext
OPTIONS['build_ext'] = {'inplace':True}
else:
extension = '.c'
# Get the list of extensions.
ext_names = ScanDir('primo', extension)
# And build up the set of Extension objects.
extensions = [MakeExtension(name, extension) for name in ext_names]
setup(packages=PACKAGES,
name=NAME,
version=VERSION,
description=DESCR,
author=AUTHOR,
author_email=EMAIL,
url=URL,
scripts=SCRIPTS,
license=LICENSE,
cmdclass=CMD_CLASS,
ext_modules=extensions,
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