File: __init__.py

package info (click to toggle)
sfact 2013.01.28-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,252 kB
  • ctags: 11,628
  • sloc: python: 36,057; xml: 4,716; sh: 51; makefile: 18
file content (9 lines) | stat: -rw-r--r-- 431 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
#This is required to workaround the python import bug where relative imports don't work if the module is imported as a main module.
import os
import sys
numberOfLevelsDeepInPackageHierarchy = 1
packageFilePath = os.path.abspath(__file__)
for level in range( numberOfLevelsDeepInPackageHierarchy + 1 ):
	packageFilePath = os.path.dirname( packageFilePath )
if packageFilePath not in sys.path:
	sys.path.insert( 0, packageFilePath )