Christophe de VIENNE unread, Oct 22, 2009, 12:51:17 PM 10/22/09
Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to toscawidge...@googlegroups.com
Hi, I found a bug (and the solution to it) with the new variant resources handling. Let's say we have two links : l1 = JSLink(modname="mod1", filename={'normal': 'path1', 'debug': 'path1debug'})
l2 = JSLink(modname="mod2", filename={'normal': 'path2'}) In this case, we have no 'debug' variant for the 'mod2' module. If we switch to the 'debug' variant, the ResourcesApp.is_resource function will not find any mod2 path (causing a 404 error), because the the __iter__ implementation :
155 def __iter__(self): 156 return self.iter_variant(self.ACTIVE_VARIANT) The iteration will never returns the 'mod2' paths.d A possible fix is to change __iter__ to : 155 def __iter__(self):
156 return chain(self.iter_variant(self.ACTIVE_VARIANT), 157 self.iter_variant(self.DEFAULT_VARIANT)) I attached a hg bundle. Thanks, Christophe
fix_noactivevariant_issue.bundle