Roundup Tracker - Issues

Message7967

Author rouilj
Recipients asavchuk, rouilj
Date 2024-03-26.20:49:06
Message-id <1711486146.36.0.744822782434.issue2551270@roundup.psfhosted.org>
In-reply-to
In changeset:   7836:219fc5804345 I committed readfile and expandfile.

    def readfile(self, name, optional=False):
    def expandfile(self, name, values=None, optional=False):

Docs are in the code with mentions in reference.txt and CHANGES.txt.
If optional is True, the methods return an empty string if the 
file can't be found. Raise NoTemplate exception otherwise.

Changes from original discussion.

Only the template directory is searched, not tracker home.

No options={} are available.

Names changed since it can be used for lots of things besides javascript.

Autofixing bare %'s in the file on TypeError is not done. When using named parameters
and a dict, that becomes a ValueError not TypeError if the following char is not a '(' or valid
format char. So '4 % 5 is a value error unsupported format character ' ' (0x20) at index 9.
It's treated like any other value error: returning n empty string and logging an Error.
History
Date User Action Args
2024-03-26 20:49:06rouiljsetmessageid: <1711486146.36.0.744822782434.issue2551270@roundup.psfhosted.org>
2024-03-26 20:49:06rouiljsetrecipients: + rouilj, asavchuk
2024-03-26 20:49:06rouiljlinkissue2551270 messages
2024-03-26 20:49:06rouiljcreate