Changeset 3377:2f0e18a21899 in livinglogic.python.xist

Show
Ignore:
Timestamp:
06/16/08 20:54:44 (11 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Drop ImportAction?.

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • NEWS.rst

    r3376 r3377  
    2121    themselves, so for example the name of the encoding to be used in an 
    2222    :class:`EncodeAction` can be the output of another action. 
     23 
     24*   :class:`ll.make.ImportAction` has been dropped as now the module object can 
     25    be used directly (e.g. as the input for an :class:`XISTPoolAction` object). 
    2326 
    2427*   :func:`ll.misc.xmlescape` now escapes ``'`` as ``&#39;`` for IE compatibility. 
  • src/ll/make.py

    r3376 r3377  
    15021502 
    15031503 
    1504 class ImportAction(Action): 
    1505     """ 
    1506     This action imports a module specified by module name. It has no inputs. 
    1507     """ 
    1508     def __init__(self, key): 
    1509         """ 
    1510         Create a :class:`ImportAction` object. :var:`key` must be the module name 
    1511         as a :class:`str`. 
    1512         """ 
    1513         Action.__init__(self) 
    1514         self.key = ModuleName(key) 
    1515         self.changed = bigbang 
    1516         self.module = None 
    1517  
    1518     def __iter__(self): 
    1519         if False: 
    1520             yield None 
    1521  
    1522     @report 
    1523     def get(self, project, since): 
    1524         if self.module is None: 
    1525             module = __import__(self.key) 
    1526             for subname in self.key.split(".")[1:]: 
    1527                 module = getattr(module, subname) 
    1528             self.changed = filechanged(url.File(module.__file__)) 
    1529             self.module = module 
    1530             args = ["Imported module %s" % self.key] 
    1531             if project.showtimestamps: 
    1532                 args.append(" (changed ") 
    1533                 args.append(project.strdatetime(self.changed)) 
    1534                 args.append(")") 
    1535             project.writestep(self, *args) 
    1536         if self.changed > since: 
    1537             return self.module 
    1538         return nodata 
    1539  
    1540     def __repr__(self): 
    1541         return "<%s.%s object key=%r at 0x%x>" % (self.__class__.__module__, self.__class__.__name__, self.key, id(self)) 
    1542  
    1543  
    15441504class AlwaysAction(Action): 
    15451505    """