当前位置: 首页>>代码示例>>Python>>正文


Python app.Application类代码示例

本文整理汇总了Python中app.Application的典型用法代码示例。如果您正苦于以下问题:Python Application类的具体用法?Python Application怎么用?Python Application使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Application类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = Group()

        self.spawners = [ TieSpawner(2000, self.ships, self.bounds) ]
开发者ID:HampshireCS,项目名称:cs143-Spring2012,代码行数:7,代码来源:main3.py

示例2: __init__

    def __init__(self):
        pygame.init()
        #self.screen_size = pygame.display.list_modes()[0]

        Application.__init__(self)
        #pygame.display.toggle_fullscreen()    


        self.ships = ShipGroup(self.max_ships)
        self.xplos = ExplosionGroup()

        self.screen_bounds = bounds = self.screen.get_rect()

        dc_height = 40
        self.dc_font = pygame.font.Font(None, 30)
        self.dc_bounds = Rect(0, bounds.height - dc_height, bounds.width, dc_height)

        self.game_bounds = Rect(0, 0, bounds.width, bounds.height - dc_height)

        spawn_area = self.game_bounds.inflate(-self.game_bounds.width/4, -self.game_bounds.height/4)
        self.spawners = [
            TieSpawner(1000, self.ships, self.game_bounds, spawn_area),
            YWingSpawner(2000, self.ships, self.game_bounds)
        ]
        self.detonator = Detonator(self.game_bounds, self.xplos)

        for spawner in self.spawners:
            spawner.spawn()


        Ship.death_count = DeathCount()
        self.current_weapon = MiniExplosionsWeapon(self)
开发者ID:HampshireCS,项目名称:cs143-Spring2012,代码行数:32,代码来源:shiphunt.py

示例3: main

def main():
    tornado.options.parse_command_line()
    app = Application()
    app.listen(options.port)
    print "start on port %s..."%options.port
    instance = tornado.ioloop.IOLoop.instance()
    tornado.autoreload.start(instance)
    instance.start()
开发者ID:yupbank,项目名称:social_analytic_tool,代码行数:8,代码来源:server.py

示例4: __init__

    def __init__(self, options):
        pygame.init()
        pygame.display.set_mode(settings.SCREEN_SIZE)
        pygame.display.set_caption(settings.CAPTION)

        self.nick = options["nick"]
        self.addr = options["addr"]
        self.port = options["port"]

        self.factory = NetworkControllerFactory(self)
        Application.__init__(self, ConnectingState)
开发者ID:HampshireCS,项目名称:CS112-Spring2012,代码行数:11,代码来源:client.py

示例5: main

def main():
    app = Application(args=docopt(__doc__))
    config = app.load_config(DataTakerConfiguration)

    app.run(decoder=DataTakerDecoder,
            data_handlers=(DataTakerDataStorer(config.store_dir,
                                               config.backup_dir),),
            connection_handlers=((DataTakerConnectionHandler(config.cmd_file)),))
开发者ID:davidfialho14,项目名称:pico_adapters,代码行数:8,代码来源:datataker.py

示例6: main

def main(args=None):
    # create the application
    app = Application()
    r = pysol_init(app, args)
    if r != 0:
        return r
    # let's go - enter the mainloop
    app.mainloop()
开发者ID:emilio-rst,项目名称:PySolFC,代码行数:8,代码来源:main.py

示例7: __init__

    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = ShipGroup(self.max_ships)

        self.spawners = [ TieSpawner(2000, self.ships, self.bounds),
                          YWingSpawner(2000, self.ships, self.bounds) ]
开发者ID:altarim992,项目名称:CS112-Spring2012,代码行数:8,代码来源:main.py

示例8: main

def main():
    app = Application(args=docopt(__doc__))
    config = app.load_config(AethalometerConfiguration)

    app.run(decoder=AethalometerDecoder,
            data_handlers=(AethalometerDataStorer(config.store_dir,
                                                  config.backup_dir),),
            connection_handlers=())
开发者ID:davidfialho14,项目名称:pico_adapters,代码行数:8,代码来源:aethalometer.py

示例9: main

def main():
    setup = Setup()
    config = setup.run()

    app = Application(config)
    app.run()

    teardown = Teardown()
    teardown.run()
开发者ID:HarveyK86,项目名称:PyREST,代码行数:9,代码来源:__main__.py

示例10: __init__

    def __init__(self):
        #initialize Application
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        #won't produce more than max_ships
        self.ships = ShipGroup(self.max_ships) #Sprite Group, makes sprite fxn (collision) easier
        self. spawners = [ TieSpawner(1000, self.ships, self.bounds),
                           YWingSpawner(2000, self.ships, self.bounds)]
        self.xplos = ExplosionGroup()
开发者ID:abonarrigo621,项目名称:CS112-Spring2012,代码行数:10,代码来源:main.py

示例11: main

def main():
    # initialize pygame
    pygame.init()
    pygame.display.set_mode((800, 600))

    # create game
    app = Application(Instruction)
    try:
        app.run()
    except KeyboardInterrupt:
        app.quit()
开发者ID:Grug16,项目名称:Save-the-Robots-Game,代码行数:11,代码来源:game.py

示例12: __init__

    def __init__(self):
        Application.__init__(self)

        self.bounds = self.screen.get_rect()
        self.ships = ShipGroup(self.max_ships)
        self.bullets = ShipGroup(self.max_ships)
        self.xplos = ExplosionGroup()
        self.score = 0
        self.player = Player(400, 560, 20, 20, self.bounds, (255, 255, 255))
        Explosion.group = self.xplos

        self.spawners = [TieSpawner(1000, self.ships, self.bounds), YWingSpawner(2000, self.ships, self.bounds)]
开发者ID:jwsander,项目名称:CS112-Spring2012,代码行数:12,代码来源:main.py

示例13: __init__

 def __init__(self,name,interval=1000):
     super(SystemTrayIcon,self).__init__()
     self.fgColor = QColor(
         Application.settingsValue("fgColor", QColor("#33b0dc")))
     self.bgColor = QColor(
         Application.settingsValue("bgColor", QColor("#144556")))
     self.interval = Application.settingsValue(
         "%s/interval" % name, interval).toInt()[0]
     
     pix = QPixmap(22,22)
     p = QPainter(pix)
     p.fillRect(pix.rect(), Qt.black)
     p.end()
     self.setIcon(QIcon(pix))
     self.startTimer( self.interval)
开发者ID:jmechnich,项目名称:appletlib,代码行数:15,代码来源:systray.py

示例14: main

def main():
	usage = "usage: %prog [-c CRAPFILE] | [CRAPFILE]"
	parser = OptionParser(usage)

	(options, args) = parser.parse_args()
	if len(args) > 1:
		parser.error("incorrect number of arguments")

	app = Application()
	if len(args):
		file_load(app.design, args[0])
		app.show_app()
		gtk.main()
	else:
		app.design.update()
		app.show_app()
		gtk.main()
开发者ID:13788593535,项目名称:machinekit,代码行数:17,代码来源:main.py

示例15: demo_main

def demo_main():
    script_basename = "youpinitel-demo"
    cfg_home = "/etc" if os.getuid() == 0 else ".youpinitel"

    parser = argparse.ArgumentParser(description="Youpi + Minitel demonstration")
    parser.add_argument(
        "-m",
        "--minitel-port",
        help="device to which the Minitel is connected (default: %(default)s)",
        dest="minitel_port",
        default="/dev/ttyUSB0",
    )
    parser.add_argument("-p", "--arm-port", help="device to which the arm interface is connected", dest="arm_port")
    parser.add_argument("-b", "--arm-busname", help="nROS bus name of the arm controller", dest="arm_busname")
    parser.add_argument(
        "-c",
        "--config-file",
        help="configuration file (default: %(default)s)",
        dest="config_file",
        type=file,
        default=os.path.join(cfg_home, "%s.json" % script_basename),
    )
    parser.add_argument("-d", "--debug", help="activates debug trace", action="store_true")

    args = parser.parse_args()

    try:
        app = Application(log=logging.getLogger("app"), **args.__dict__)

    except Exception as e:
        if args.debug:
            logging.exception("unexpected error")
        logging.getLogger().fatal("unable to initialize application instance (%s)", e)

    else:
        try:
            app.run()
        except Exception as e:
            if args.debug:
                logging.exception("unexpected error")
            else:
                # logging.getLogger().fatal('unexpected error : (%s) %s', e.__class__.__name__, e)
                logging.getLogger().exception(e)
        else:
            logging.getLogger().info("application terminated")
开发者ID:EricPobot,项目名称:youpinitel-v1-raspi,代码行数:45,代码来源:entry_points.py


注:本文中的app.Application类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。