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

[Cheetahtemplate-discuss] Some issues spotted by pychecker

Expand Messages
  • Alejandro Dubrovsky
    Hi, I ve been running pychecker on the src directory of the CVS version, and some of the problems it throws up seem to be real, if not very important (due to
    Message 1 of 2 , Nov 30, 2006
    • 0 Attachment
      Hi,

      I've been running pychecker on the src directory of the CVS version, and
      some of the problems it throws up seem to be real, if not very important
      (due to either the usual code paths not going through those spots or
      they being not very important problems). Here are some (if you would
      prefer diffs, I can do that):

      NameMapper.py:

      Line 185: excString += ' in the namespace %s'%pformat(namespace)
      should be excStr += ' in the namespace %s'%pformat(namespace)

      SettingsManager.py:

      Line 490: return copy(self._settings)
      should be return copyModule.copy(self._settings)

      Line 494: return deepcopy(self._settings)
      should be return copyModule.deepcopy(self._settings)

      Line 36: imp imported for a second time (first time on line 31)

      ImportManager.py:

      Line 83: path = s
      seems like a remnant from a previous version which will just trigger an
      error now.

      Parser.py:

      Line 979: self.setPos(enclosures[-1][1])
      enclosures doesn't seem to be defined in getDefArgList

      Line 1247: expr = self._compiler.genCheetahVar(nameChunks[:],
      plain=plain)

      self._compiler is only defined in HighLevelParser, not LowLevelParser.

      Same with line 1269: expr =
      self._applyExpressionFilters(expr,'placeholder',rawExpr=rawPlaceholder,startPos=startPos)

      _applyExpressionFilters also is only part of HighLevelParser.

      Line 1792: raise ParserError(self)
      should be raise ParseError(self)

      SourceReader.py:
      Line 168: raise Error("Invalid bookmark (" + name + ', '+ str(pos) + ")
      is invalid: does not exist" )
      pos hasn't been defined at that point.

      Compiler.py:
      Line 1248: self.addChunk('self._compile(file=self._filePath,
      moduleName='+className + ')')
      should probably be self.addChunk('self._compile(file=self._filePath,
      moduleName='+self._className + ')')

      alejandro



      -------------------------------------------------------------------------
      Take Surveys. Earn Cash. Influence the Future of IT
      Join SourceForge.net's Techsay panel and you'll get the chance to share your
      opinions on IT & business topics through brief surveys - and earn cash
      http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Tavis Rudd
      Thanks Alejandro. I ve just fixed these. They were all in bits of code that have been sitting there unused for years. ... Take Surveys. Earn Cash. Influence
      Message 2 of 2 , Apr 2, 2007
      • 0 Attachment
        Thanks Alejandro. I've just fixed these. They were all in bits of code
        that have been sitting there unused for years.

        On Fri, 1 Dec 2006, Alejandro Dubrovsky wrote:

        > Hi,
        >
        > I've been running pychecker on the src directory of the CVS version, and
        > some of the problems it throws up seem to be real, if not very important
        > (due to either the usual code paths not going through those spots or
        > they being not very important problems). Here are some (if you would
        > prefer diffs, I can do that):
        >
        > NameMapper.py:
        >
        > Line 185: excString += ' in the namespace %s'%pformat(namespace)
        > should be excStr += ' in the namespace %s'%pformat(namespace)
        >
        > SettingsManager.py:
        >
        > Line 490: return copy(self._settings)
        > should be return copyModule.copy(self._settings)
        >
        > Line 494: return deepcopy(self._settings)
        > should be return copyModule.deepcopy(self._settings)
        >
        > Line 36: imp imported for a second time (first time on line 31)
        >
        > ImportManager.py:
        >
        > Line 83: path = s
        > seems like a remnant from a previous version which will just trigger an
        > error now.
        >
        > Parser.py:
        >
        > Line 979: self.setPos(enclosures[-1][1])
        > enclosures doesn't seem to be defined in getDefArgList
        >
        > Line 1247: expr = self._compiler.genCheetahVar(nameChunks[:],
        > plain=plain)
        >
        > self._compiler is only defined in HighLevelParser, not LowLevelParser.
        >
        > Same with line 1269: expr =
        > self._applyExpressionFilters(expr,'placeholder',rawExpr=rawPlaceholder,startPos=startPos)
        >
        > _applyExpressionFilters also is only part of HighLevelParser.
        >
        > Line 1792: raise ParserError(self)
        > should be raise ParseError(self)
        >
        > SourceReader.py:
        > Line 168: raise Error("Invalid bookmark (" + name + ', '+ str(pos) + ")
        > is invalid: does not exist" )
        > pos hasn't been defined at that point.
        >
        > Compiler.py:
        > Line 1248: self.addChunk('self._compile(file=self._filePath,
        > moduleName='+className + ')')
        > should probably be self.addChunk('self._compile(file=self._filePath,
        > moduleName='+self._className + ')')
        >
        > alejandro
        >
        >
        >
        > -------------------------------------------------------------------------
        > Take Surveys. Earn Cash. Influence the Future of IT
        > Join SourceForge.net's Techsay panel and you'll get the chance to share your
        > opinions on IT & business topics through brief surveys - and earn cash
        > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
        > _______________________________________________
        > Cheetahtemplate-discuss mailing list
        > Cheetahtemplate-discuss@...
        > https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        >

        -------------------------------------------------------------------------
        Take Surveys. Earn Cash. Influence the Future of IT
        Join SourceForge.net's Techsay panel and you'll get the chance to share your
        opinions on IT & business topics through brief surveys-and earn cash
        http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      Your message has been successfully submitted and would be delivered to recipients shortly.