Ejemplo n.º 1
0
    def loadOptions(self):
        '''
        Load options from config file
        '''

        r = ResourceManager()

        dist.ensure_config_dir( r["config"].path )

        OptionManager.__options = ConfigParser.ConfigParser()
        OptionManager.__options.read( r["config"][constants.OPTION_CONFIG] )
        self.options = OptionManager.__options
Ejemplo n.º 2
0
    def loadOptions(self):
        '''
        Load options from config file
        '''

        r = ResourceManager()

        dist.ensure_config_dir(r["config"].path)

        OptionManager.__options = ConfigParser.ConfigParser()
        OptionManager.__options.read(r["config"][constants.OPTION_CONFIG])
        self.options = OptionManager.__options
Ejemplo n.º 3
0
 def configure(self):
     '''
     Configure the server
     '''
     dist.ensure_config_dir(dist.CONFIG_DIR)
     resources = manager.ResourceManager()
     logging.basicConfig(level=logging.DEBUG,
                 format='%(asctime)s %(name)s %(levelname)s %(message)s',
                 filename=resources["config"][constants.LOG_FILE],
                 filemode='w')
     
     
     config = resources["config"][constants.SERVER_CONSOLE_CONFIG]
     
     if not os.path.exists(config):
         raise IOError, "%s must exist in %s" % (constants.SERVER_CONSOLE_CONFIG, resources["config"].path)
         
     parser = ConfigParser.ConfigParser()
     parser.read( config )
     self.w_port = int(parser.get("pyscrabble","web_port"))
     self.g_port = int(parser.get("pyscrabble","game_port"))
Ejemplo n.º 4
0
import gettext
gettext.install(constants.LOCALE_DOMAIN, constants.LOCALE_DIR)

from pyscrabble import manager
l = manager.LocaleManager()

from pyscrabble import dist
from pyscrabble import gtkconstants
from pyscrabble import gtkutil
from twisted.internet import reactor
from pyscrabble.gui.login import LoginWindow
import gtk

if __name__ == '__main__':

    dist.ensure_config_dir(dist.CONFIG_DIR)

    gtk.rc_parse_string(gtkconstants.DEFAULT_THEME)
    gtkutil.setupStockItems()

    o = manager.OptionManager()

    def callback():
        LoginWindow()

    if o.get_default_bool_option(constants.OPTION_SHOW_TIPS, True):
        from pyscrabble.gui import tip
        tip.TipWindow(tip=tip.WELCOME_TIP, callback=callback)
    else:
        callback()