Example #1
0
def main():
    log.message("Starting IGE - Outer Space Messager Client version",
                Ver.versionString)
    log.debug("sys.path =", sys.path)
    log.debug("os.name =", os.name)

    # create required directories
    if not os.path.exists('var'):
        os.mkdir('var')

# parse configuration
    gdata.config = Config('var/osci.ini')

    # default configuration
    if gdata.config.game.server == None:
        gdata.config.game.server = 'www.ospace.net:9080'

# prepare internationalization
    if gdata.config.client.language == None:
        gdata.config.client.language = 'en'

    language = gdata.config.client.language

    import gettext
    try:
        tran = gettext.translation('OSPACE', 'res', languages=[language])
    except IOError:
        log.warning('OSCI', 'Cannot find catalog for', language)
        log.message('OSCI', 'Installing null translations')
        tran = gettext.NullTranslations()

    tran.install(unicode=1)
    log.message('OSCI', 'Translations installed for %s languaage' % language)

    # client
    from igeclient.IClient import IClientException

    client.initialize(gdata.config.game.server, handler)

    app = App(False)
    app.MainLoop()

    # write configuration
    log.debug("Saving configuration.")
    gdata.config.save('var/osci.ini')

    # logout
    client.logout()

    log.debug("Shut down")
Example #2
0
def main():
	log.message("Starting IGE - Outer Space Messager Client version", Ver.versionString)
	log.debug("sys.path =", sys.path)
	log.debug("os.name =", os.name)

    # create required directories
	if not os.path.exists('var'):
		os.mkdir('var')

    # parse configuration
	gdata.config = Config('var/osci.ini')

    # default configuration
	if gdata.config.game.server == None:
		gdata.config.game.server = 'www.ospace.net:9080'

    # prepare internationalization
	if gdata.config.client.language == None:
		gdata.config.client.language = 'en'

	language = gdata.config.client.language

	import gettext
	try:
		tran = gettext.translation('OSPACE', 'res', languages = [language])
	except IOError:
		log.warning('OSCI', 'Cannot find catalog for', language)
		log.message('OSCI', 'Installing null translations')
		tran = gettext.NullTranslations()

	tran.install(unicode = 1)
	log.message('OSCI', 'Translations installed for %s languaage' % language)

	# client
	from igeclient.IClient import IClientException

	client.initialize(gdata.config.game.server, handler)

	app = App(False)
	app.MainLoop()

	# write configuration
	log.debug("Saving configuration.")
	gdata.config.save('var/osci.ini')

	# logout
	client.logout()

	log.debug("Shut down")
Example #3
0
app.windowSurfaceFlags = SWSURFACE | SRCALPHA
gdata.app = app

# resources
import res

res.initialize()

# load resources
res.loadResources()

# client
import client, handler
from igeclient.IClient import IClientException

client.initialize(gdata.config.game.server, handler, options)

# create initial dialogs
import dialog

gdata.savePassword = gdata.config.game.lastpasswordcrypted != None

if options.login and options.password:
	gdata.config.game.lastlogin = options.login
	gdata.config.game.lastpassword = options.password
	gdata.config.game.lastpasswordcrypted = binascii.b2a_base64(options.password).strip()
	gdata.config.game.autologin = '******'
	gdata.savePassword = '******'


Example #4
0
from flask import Flask, json, request
import client
import base64
import pickle
import model_maintainer as models

api = Flask(__name__)


@api.route('/prediction', methods=['POST'])
def get_prediction():
    data = pickle.loads(base64.b64decode(request.data))
    print(f'got request /prediction, entries: {len(data)}')
    return base64.b64encode(pickle.dumps(models.make_prediction(data)))


if __name__ == '__main__':
    model_list = [('B', '../data/model_b'), ('A', '../data/model_a')]
    client.initialize(3)
    models.initialize(model_list, 3)
    api.run(port=8080)

Example #5
0
try:
    appUpdate.checkForUpdate()
except SystemExit, e:
    raise e
except:
    log.warning('OSCI', 'Update failed.')

# load resources
res.loadResources()

# client
import client, handler
from igeclient.IClient import IClientException

client.initialize(gdata.config.game.server, handler)

# display login
import dialog

gdata.savePassword = gdata.config.game.lastpasswordcrypted != None
logdlg = dialog.LoginDlg(gdata.app)
logdlg.display()
# event loop
update()

running = 1
lastSave = time.clock()
counter = 0
needsRefresh = False