Exemplo n.º 1
0
    def __init__(self, config_file_name="config.xml"):
        """Constructor that calls constructor of super class Configuration and 
            forms path to game_settings

            Keyword arguments:
            config_file_name -- the name of the XML configuration file (default 
                                                                    config.xml)

        """
        Configuration.__init__(self, config_file_name)
        # definition of the path for the game_settings configuration file
        self.path_game_settings = Configuration.get_base_path(self) + "game_settings.xml"
Exemplo n.º 2
0
    def __init__(self, config_file_name="config.xml"):
        """Constructor that calls constructor of super class Configuration and 
            forms path to game_settings

            Keyword arguments:
            config_file_name -- the name of the XML configuration file (default 
                                                                    config.xml)

        """
        Configuration.__init__(self, config_file_name)
        #definition of the path for the game_settings configuration file
        self.path_game_settings = Configuration.get_base_path(
            self) + "game_settings.xml"
Exemplo n.º 3
0
    def __init__(self, log, decks, card_counting_strategy_section="Blackjack"):
        # Initialize variables
        self.decks = decks

        # Initialize and read INI file
        Configuration.__init__(self, log, "card_counting.ini",
                               card_counting_strategy_section)

        # Initialize event listener
        EventListener.__init__(self, log)

        # Load card counting strategy
        self.load_card_counting_strategy(card_counting_strategy_section)

        # Reset count
        self.reset_count()
Exemplo n.º 4
0
    def __init__(self, log, rules_section="Blackjack"):
        # Initialize and read INI file
        Configuration.__init__(self, log, "rules.ini", rules_section)

        # Read section
        self.decks = Configuration.read_int(self, "Decks", 4)
        self.minimum_bet = Configuration.read_int(self, "MinimumBet", 1)
        self.maximum_bet = Configuration.read_int(self, "MaximumBet", 100)
        self.blackjack_payout = Configuration.read_double(
            self, "BlackjackPayout", 1.5)
        self.double_down_on_all = Configuration.read_boolean(
            self, "DoubleDownOnAll", False)
        self.push_goes_to_dealer = Configuration.read_boolean(
            self, "PushGoesToDealer", False)
        self.dealer_hits_on_soft_17 = Configuration.read_boolean(
            self, "DealerHitsOnSoft17", False)
        self.insurance_allowed = Configuration.read_boolean(
            self, "InsuranceAllowed", False)
        self.surrender_allowed = Configuration.read_boolean(
            self, "SurrenderAllowed", False)
Exemplo n.º 5
0
    def __init__(self, **kwargs):

        self.remote = False

        # add preferences to the configuration
        # TODO: do at class level
        self.options.append(('preferences', {'help': 'browser preferences',
                                             'default': self.preferences,
                                             'flags': []}))

        # set arguments to dump to a configuration file
        kwargs.setdefault('dump', ['-o', '--output'])

        # set usage argument
        kwargs.setdefault('usage', '%prog [options] manifest.yml [manifest.yml] [...]')

        # TODO: something about deviceroot:
        # http://hg.mozilla.org/build/talos/file/c702ff8892be/talos/PerfConfigurator.py#l44

        # call parent constructor
        Configuration.__init__(self, **kwargs)
Exemplo n.º 6
0
    def __init__(self, **kwargs):

        self.remote = False

        # add preferences to the configuration
        # TODO: do at class level
        self.options.append(('preferences', {
            'help': 'browser preferences',
            'default': self.preferences,
            'flags': []
        }))

        # set arguments to dump to a configuration file
        kwargs.setdefault('dump', ['-o', '--output'])

        # set usage argument
        kwargs.setdefault('usage',
                          '%prog [options] manifest.yml [manifest.yml] [...]')

        # TODO: something about deviceroot:
        # http://hg.mozilla.org/build/talos/file/c702ff8892be/talos/PerfConfigurator.py#l44

        # call parent constructor
        Configuration.__init__(self, **kwargs)
Exemplo n.º 7
0
 def __init__(self, context):
     Configuration.__init__(self, context)
Exemplo n.º 8
0
 def __init__(self, context):
     Configuration.__init__(self, context)
Exemplo n.º 9
0
 def __init__(self, config, section):
     Configuration.__init__(self)
     for (name, value) in config.sections[section]:
         # print "reading %s" % name
         (values, default) = parse(value)
         self += Parameter(name, values, default) 
Exemplo n.º 10
0
 def __init__(self, log):
     # Initialize and read INI file
     Configuration.__init__(self, log, self.FILENAME)