"""This is the entry point to load and run blade package. """ import sys import os.path # Load package from blade.zip or source dir? blade_path = os.path.abspath( os.path.join(os.path.dirname(__file__), 'blade.zip')) # blade_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/blade')) sys.path.insert(0, blade_path) import blade_main blade_main.main(blade_path)
"""This is the entry point to load and run blade package. """ import sys import os.path # Load package from blade.zip or source dir? blade_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'blade.zip')) # blade_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src/blade')) sys.path.insert(0, blade_path) import blade_main blade_main.main(blade_path)
""" Copyright (c) 2013 Tencent Inc. All rights reserved. Author: Feng chen <*****@*****.**> """ import sys import os.path def _find_package_path(): self_path = os.path.dirname(__file__) package_path = os.path.join(self_path, 'src/blade') # Develop mode if not os.path.exists(package_path): package_path = os.path.join(self_path, 'blade.zip') return package_path package_path = _find_package_path() sys.path.insert(0, package_path) import blade_main blade_main.main(package_path)
#!/usr/bin/env python """About main entry Main entry is placed to __main__.py, cause we need to pack the python sources to a zip ball and invoke the blade through command line in this way: python blade.zip """ import sys from blade_main import main if __name__ == '__main__': main(sys.argv[0])
""" Copyright (c) 2013 Tencent Inc. All rights reserved. Author: Feng chen <*****@*****.**> """ import sys import os.path zip_path = os.path.abspath(os.path.join(os.path.dirname(__file__), 'blade.zip')) sys.path.insert(0, zip_path) import blade_main blade_main.main(zip_path)