Пример #1
0
 def __init__(self):
     LOGGING_LEVEL = logging.DEBUG if proxy.prefValue_(
         'DebugMode') else logging.WARNING
     logging.basicConfig(level=LOGGING_LEVEL,
                         format='%(levelname)s %(message)s',
                         handlers=[CocoaHandler()])
     install_exception_hook('https://github.com/hsoft/moneyguru/issues')
     logging.debug('started in debug mode')
     cache_path = op.join(proxy.getCachePath(), 'moneyGuru')
     appdata_path = op.join(proxy.getAppdataPath(), 'moneyGuru')
     currency_code = nonone(proxy.systemCurrency(), 'USD')
     logging.info('Currency code: {0}'.format(currency_code))
     try:
         system_currency = Currency(currency_code)
     except ValueError:  # currency does not exist
         logging.warning(
             'System currency {0} is not supported. Falling back to USD.'.
             format(currency_code))
         system_currency = USD
     date_format = proxy.systemShortDateFormat()
     logging.info('System date format: %s' % date_format)
     date_format = clean_format(date_format)
     logging.info('Cleaned date format: %s' % date_format)
     decimal_sep = proxy.systemNumberDecimalSeparator()
     grouping_sep = proxy.systemNumberGroupingSeparator()
     logging.info('System numeric separators: %s and %s' %
                  (grouping_sep, decimal_sep))
     model = Application(self,
                         date_format=date_format,
                         decimal_sep=decimal_sep,
                         grouping_sep=grouping_sep,
                         default_currency=system_currency,
                         cache_path=cache_path,
                         appdata_path=appdata_path)
     PyBaseApp.__init__(self, model)
Пример #2
0
def main():
    # initialize pygame
    pygame.init()
    pygame.display.set_mode((1024, 768))
    pygame.display.set_caption("Super Coin Get v1.0")

    # create game
    app = Application(MainMenu)
    try:
        app.run()
    except KeyboardInterrupt:
        app.quit()
    finally:
        pygame.display.quit()
        pygame.quit()
Пример #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import click

from core.app import Application


@click.group()
def cli():
    pass


@cli.command()
@click.pass_context
def init_db(context):
    import core.models
    context.obj.db.create_all()


@cli.command()
@click.pass_context
def run(context):
    context.obj.run()


if __name__ == '__main__':
    cli(obj=Application())
Пример #4
0
import logging
import tornado.web
import tornado.ioloop
import tornado.httpserver
from tornado.options import define, options
from core.app import Application

if __name__ == '__main__':
    define('port', default=8888, help='Port listened')
    tornado.options.parse_command_line()
    http_server = tornado.httpserver.HTTPServer(Application())
    http_server.listen(options.port)
    logging.basicConfig(format='%(asctime) %(message)s')
    logging.warning('WebSocket Injection Proxy Listening on 0.0.0.0:%d' %
                    options.port)
    tornado.ioloop.IOLoop.instance().start()
Пример #5
0
def main():
    res = Resources()
    app = Application((800, 600), "Editor", resizable=True)
    app.process(Editor())
    app.run()