Loading ...
Sorry, an error occurred while loading the content.

701[Cheetahtemplate-discuss] NT #import broken and respond() issue

Expand Messages
  • Greg Czajkowski
    Feb 1, 2002
      I filed a bug #511423. Does anyone have any ideas or
      has it been fixed in CVS?

      Also when I pass object instances into Cheetah and
      then try to have to instance interpololated by calling
      __str__ Cheetah instead insists on the instance having
      the respond method, why?

      #def function($instance)
      $instance
      #end def

      Thanks
      -------Bug Info-----------------------------------
      There's a couple problems on NT with importing:
      packageName = 'Cheetah.Temp.' + dirName.replace
      ('\\', '/').replace('/', '_')

      Causes a creation of a bad package name
      [Dbg]>>> dirName
      'C:\\'
      [Dbg]>>> packageName
      'Cheetah.Temp.C:_'

      Further more. Simple #imports of modules in sys.path
      dont work

      File "MyTemplate.py", line 43, in __init__
      Template.__init__(self, template)
      File "C:\pzehr\tchain\packages\Cheetah\Template.py",
      line 187, in __init__
      self.compile(source, file)
      File "C:\pzehr\tchain\packages\Cheetah\Template.py",
      line 218, in compile
      compiler.compile()
      File "C:\pzehr\tchain\packages\Cheetah\Compiler.py",
      line 1063, in compile
      self.parse()
      File "C:\pzehr\tchain\packages\Cheetah\Parser.py",
      line 1025, in parse
      self.eatDirective()
      File "C:\pzehr\tchain\packages\Cheetah\Parser.py",
      line 1140, in eatDirective
      self.directiveEaters[directiveKey]()
      File "C:\pzehr\tchain\packages\Cheetah\Parser.py",
      line 1399, in eatImport
      mod = self._templateObj._importAsDummyModule
      (impStatement)
      File "C:\pzehr\tchain\packages\Cheetah\Template.py",
      line 403, in _importAsDummyModule
      packageName = self._makeDummyPackageForDir
      (os.getcwd())
      File "C:\pzehr\tchain\packages\Cheetah\Template.py",
      line 392, in _makeDummyPackageForDir
      isPackageDir=1,forceReload=1)
      File "C:\pzehr\tchain\packages\Cheetah\Template.py",
      line 445, in _importModuleFromDirectory
      fp, pathname, stuff = imp.find_module(moduleName,
      [directory])
      NameError: Can't find file for module
      (filename C:\)

      __________________________________________________
      Do You Yahoo!?
      Great stuff seeking new owners in Yahoo! Auctions!
      http://auctions.yahoo.com

      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss