Commits

Ralph Bean committed 5cbce85

JS and CSSSource require a .src attr.

  • Participants
  • Parent commits f30beb3

Comments (0)

Files changed (1)

File tw2/core/resources.py

     def __repr__(self):
         return "%s('%s')" % (self.__class__.__name__, self.src)
 
+    def prepare(self):
+        super(JSSource, self).prepare()
+        if not self.src:
+            raise ValueError("%r must be provided a 'src' attr" % self)
+
 
 class CSSSource(Resource):
     """
     def __repr__(self):
         return "%s('%s')" % (self.__class__.__name__, self.src)
 
+    def prepare(self):
+        super(CSSSource, self).prepare()
+        if not self.src:
+            raise ValueError("%r must be provided a 'src' attr" % self)
+
 
 class _JSFuncCall(JSSource):
     """