comparison makeitso/template.py @ 66:7821c82772f5

determine the location in a better way
author Jeff Hammel <jhammel@mozilla.com>
date Fri, 07 Jan 2011 10:53:12 -0800
parents 0152741621c1
children a0f7bfa98755
comparison
equal deleted inserted replaced
65:0152741621c1 66:7821c82772f5
76 # boilerplate 76 # boilerplate
77 assert self.templates 77 assert self.templates
78 variables = variables or {} 78 variables = variables or {}
79 self.output = output 79 self.output = output
80 self.interactive = interactive 80 self.interactive = interactive
81 self.location = os.path.dirname(os.path.abspath(__file__)) 81 _file = sys.modules[self.__class__.__module__].__file__
82 self.location = os.path.dirname(os.path.abspath(_file))
82 self.defaults = variables.copy() 83 self.defaults = variables.copy()
83 self.usedefaults = usedefaults 84 self.usedefaults = usedefaults
84 85
85 # make a dictionary of the variables for lookup convenience 86 # make a dictionary of the variables for lookup convenience
86 self.vardict = {} 87 self.vardict = {}