Logo Search packages:      
Sourcecode: zeroinstall-injector version File versions

def zeroinstall::injector::policy::Policy::__init__ (   self,
  root,
  handler = None,
  src = False 
)

@param root: The URI of the root interface (the program we want to run).
@param handler: A handler for main-loop integration.
@type handler: L{zeroinstall.injector.handler.Handler}
@param src: Whether we are looking for source code.
@type src: bool

Definition at line 108 of file policy.py.

00108                                                            :
            """
            @param root: The URI of the root interface (the program we want to run).
            @param handler: A handler for main-loop integration.
            @type handler: L{zeroinstall.injector.handler.Handler}
            @param src: Whether we are looking for source code.
            @type src: bool
            """
            self.watchers = []
            self.help_with_testing = False
            self.network_use = network_full
            self.freshness = 60 * 60 * 24 * 30
            self.ready = False
            self.src = src                      # Root impl must be a "src" machine type
            self.restrictions = {}

            # This is used in is_unusable() to check whether the impl is
            # for the root interface when looking for source. It is also
            # used to add restrictions to the root (e.g. --before and --not-before)
            self.root_restrictions = []

            # If we need to download something but can't because we are offline,
            # warn the user. But only the first time.
            self._warned_offline = False

            # (allow self for backwards compat)
            self.handler = handler or self

            debug("Supported systems: '%s'", arch.os_ranks)
            debug("Supported processors: '%s'", arch.machine_ranks)

            path = basedir.load_first_config(config_site, config_prog, 'global')
            if path:
                  try:
                        config = ConfigParser.ConfigParser()
                        config.read(path)
                        self.help_with_testing = config.getboolean('global',
                                                'help_with_testing')
                        self.network_use = config.get('global', 'network_use')
                        self.freshness = int(config.get('global', 'freshness'))
                        assert self.network_use in network_levels
                  except Exception, ex:
                        warn("Error loading config: %s", ex)

            self.set_root(root)

            # Probably need weakrefs here...
            iface_cache.add_watcher(self)
            trust_db.watchers.append(self.process_pending)
      
      def set_root(self, root):


Generated by  Doxygen 1.6.0   Back to index