Changeset c2a4fd917856254c97d59fe329760c10d6c1d018


Ignore:
Timestamp:
30.07.2013 13:20:52 (8 years ago)
Author:
Stanislaw Klekot <dozzie@…>
Branches:
b66903eafbcb1d49112014abc82c8bf683413db0
Children:
e57942eb8ff828ca9d9de7d2fa6f931c994a59e8
Parents:
c2a258145d212be11d868d6705d97e44c8a07bb7
git-author:
Stanislaw Klekot <dozzie@…> (30.07.2013 13:20:33)
git-committer:
Stanislaw Klekot <dozzie@…> (30.07.2013 13:20:52)
Message:

Changed way of passing resource cache in protocol plugin.

This way will be a little clearer, probably easier to implement as an API for
users.

Location:
dashwiki
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dashwiki/macros/models.py

    ra87b72 rc2a4fd  
    3232  def call(self, args, cache): 
    3333    from dashwiki.plugins import load_plugin 
    34     plugin_instance = load_plugin(self) 
    35     result = plugin_instance.call(args, cache) 
     34    plugin_instance = load_plugin(self, cache) 
     35    result = plugin_instance.call(args) 
    3636    return result 
    3737 
  • dashwiki/plugins/ProtocolPlugin.py

    rfb3b23 rc2a4fd  
    1616    self.protocol     = kwargs['protocol'] 
    1717 
     18    # dashwiki.resource_cache.ResourceCache 
     19    self.cache = kwargs['cache'] 
    1820    # planned: {} 
    1921    self.actual_args = None 
  • dashwiki/plugins/__init__.py

    rbc6a4f rc2a4fd  
    1616} 
    1717 
    18 def load_plugin(macro): 
     18def load_plugin(macro, cache): 
    1919  return _protocols[macro.protocol.name]( 
    2020    name        = macro.name, 
     
    2424    result_type = macro.result_type.name, 
    2525    protocol    = macro.protocol.name, 
     26    cache       = cache, 
    2627  ) 
    2728 
Note: See TracChangeset for help on using the changeset viewer.