Beispiel #1
0
 def get_option(self, opt_dest):
     """
     Get an option from opts or from the config file
     Options from opts take precedence.
     @type opt: str
     @param opt: name of option to get
     @return: value of the option or None if the option is no present
     """
     attr = getattr(self.opts, opt_dest, None)
     return u_obj(attr)
Beispiel #2
0
 def get_option(self, opt_dest):
     """
     Get an option from opts or from the config file
     Options from opts take precedence.
     @type opt: str
     @param opt: name of option to get
     @return: value of the option or None if the option is no present
     """
     attr = getattr(self.opts, opt_dest, None)
     return u_obj(attr)
Beispiel #3
0
 def get_option(self, opt_dest, default=None):
     """
     Get an option from opts or from the config file
     Options from opts take precedence.
     
     :type opt: str
     :param opt: name of option to get
     :return: value of the option or None if the option is no present
     """
     attr = getattr(self.opts, opt_dest, None)
     if not default is None and attr is None:
         attr = default
     return u_obj(attr)
Beispiel #4
0
    def get_option(self, opt_dest):
        """
        Get an option from opts or from the config file
        Options from opts take precedence.
        @type opt: str
        @param opt: name of option to get
        @return: value of the option or None if the option is no present
        """
        attr = getattr(self.opts, opt_dest, None)
        if not attr:
            option = self.parser.get_option_by_dest(opt_dest)
            if option != None:
                opt_name = option.get_name()
                if Config.parser.has_option('options', opt_name):
                    attr = Config.parser.get('options', opt_name)

        return u_obj(attr)