Пример #1
0
def main():
    app = init_app()
    manager = Manager(app)
    manager.add_command('seed', Seed())
    # manager.add_command('import', ImportVisitors())
    manager.run()
    return app
Пример #2
0
def make_shell_context():
    return dict(app=current_app,
                user_models=user_models,
                product_models=product_models,
                common_methods=common_methods,
                db=db,
                seed=Seed())
Пример #3
0
def main():
    if ARGS.merge:
        merge_json()
    elif ARGS.csv:
        Seed().to_json()
    else:
        raise ValueError(
            "Missing argument. To see list of arguments use --help.")
Пример #4
0
 def do_reset_seeds(self):
     self.master = Seed()
     self.stretched_master = Seed()
     self.seed = Seed()
     self.update_prompt()
Пример #5
0
 def __init__(self):
     Cmd.__init__(self)
     self.master = Seed()
     self.stretched_master = Seed()
     self.seed = Seed()
     self.recovery_package = None
Пример #6
0
 def setUp(self):
     self.seed = Seed(seed_list='./testing/seedlist')
Пример #7
0
from flask_migrate import Migrate
from flask_migrate import MigrateCommand
from flask_script import Manager

from ros.lib.app import app, db
from seed import Seed

migrate = Migrate(app, db)
manager = Manager(app)
manager.add_command("db", MigrateCommand)
manager.add_command('seed', Seed())

if __name__ == "__main__":
    manager.run()
Пример #8
0
    def set_game(self):
        self.pacman_alive = True
        self.kostul = True
        self.counterOfEatenFruits = 0
        self.gameover_exists = False
        self.counter = Counter()
        self.state = STATES["game"]
        self.ghosts.clear()
        self.objects.clear()
        self.objects.append(
            GameField([
                pygame.transform.scale(pygame.image.load("./Entity/Map.png"),
                                       (424, 468))
            ], [0, 0, 424, 468]))
        self.objects.append(
            Pacman(self.genPacmanImg(), [229, 255, 20, 20], 0, 1))
        self.start_v = 33
        self.finish_v = 34
        cnt = -1
        for v in self.graph.coordinates:
            cnt += 1
            name_on = "./Entity/Fruit/ SeedOn.png"
            name_off = "./Entity/Fruit/seedOff.png"
            self.objects.append(
                Seed([[
                    pygame.transform.scale(pygame.image.load(name_on), (2, 2))
                ], [
                    pygame.transform.scale(pygame.image.load(name_off), (2, 2))
                ]], [v[0] - 1, v[1] - 1, 2, 2]))  ## 3-68 элементы - зерна
            if 28 <= cnt <= 30:
                self.objects[-1].change_type(1)
        self.objects.append(
            Ghost(self.genPinkGhostImg(), [
                self.graph.coordinates[29][0], self.graph.coordinates[29][1],
                20, 20
            ], 0))  ## 69 элемент - розовый призрак
        self.objects.append(
            Ghost(self.genRedGhostImg(), [
                self.graph.coordinates[28][0], self.graph.coordinates[28][1],
                20, 20
            ], 0))  ## 70 элемент - красный призрак

        cnt = -1
        cnt = random.randint(0, 66)  # генерация фруктов
        while (28 <= cnt <= 30):
            cnt = random.randint(0, 66)
        v = self.graph.coordinates[cnt]
        self.objects[cnt + 2].change_type(1)
        i = random.randint(1, 5)
        self.fruit_index = len(self.objects)
        name_on = "./Entity/Fruit/fruit" + str(i) + ".png"
        name_off = "./Entity/Fruit/seedOff.png"
        self.objects.append(
            Fruit([[
                pygame.transform.scale(pygame.image.load(name_on), (15, 15))
            ], [pygame.transform.scale(pygame.image.load(name_off),
                                       (15, 15))]],
                  [v[0] - 5, v[1] - 8, 15, 15]))
        #self.objects[69].move_to_point([self.graph.coordinates[29][0], self.graph.coordinates[29][1]])
        self.objects[69].start_moving_to_point([
            self.graph.coordinates[23][0] - 10,
            self.graph.coordinates[23][1] - 10
        ])
        self.ghosts.append([69, 29, 23])
        self.objects[70].start_moving_to_point([
            self.graph.coordinates[29][0] - 10,
            self.graph.coordinates[29][1] - 10
        ])
        self.ghosts.append([70, 28, 29])
Пример #9
0
 def _get_seed_account_id(self):
     seed = Seed(self.api_key)
     return seed.execute()
Пример #10
0
def getseed(name):
    for s in SeedList:
        if s['name'] == name:
            out = Seed(s['x'], s['y'], s['name'], s['seed'])
            return out
Пример #11
0
 def __init__(self):
     pygame.init()
     pygame.font.init()
     self.pacman = Pacman()
     self.map_start = time.monotonic()
     self.Highscore = highscore.Highscore()
     self.positionD = 380, 306
     self.positionG = 400, 306
     self.positionS = 360, 306
     self.position = 380, 290
     self.Ghost = Ghost(self.position)
     self.Gannibal = Gannibal(self.positionG)
     self.Stalker = Stalker(self.positionS)
     self.Debil = Debil(self.positionD)
     self.Output = Output()
     self.Seed = Seed()
     self.Berry = Berry()
     self.bigseed = BigSeed()
     self.gameover = False
     self.map = [[
         2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
         2, 2, 2, 2
     ],
                 [
                     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
                     2, 2, 2, 2, 2, 2, 2, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                     1, 1, 1, 1, 1, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
                     0, 0, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 3, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1,
                     1, 1, 0, 1, 1, 3, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1,
                     1, 1, 0, 1, 1, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                     0, 0, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1,
                     0, 1, 0, 1, 1, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
                     0, 1, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1, 1, 1, 2, 1, 2, 1,
                     1, 1, 0, 1, 1, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 2, 2, 2, 2, 2, 2,
                     2, 1, 0, 1, 2, 2, 2, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1,
                     2, 1, 0, 1, 1, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 1, 2, 2, 2, 1,
                     2, 2, 0, 2, 2, 2, 2, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1,
                     2, 1, 0, 1, 1, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 2, 2, 2, 2, 2, 2,
                     2, 1, 0, 1, 2, 2, 2, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 1, 2, 1, 1, 1, 1, 1,
                     2, 1, 0, 1, 1, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
                     0, 0, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1,
                     1, 1, 0, 1, 1, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 3, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0,
                     0, 0, 0, 1, 0, 3, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1,
                     0, 1, 0, 1, 0, 1, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0,
                     0, 1, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1,
                     1, 1, 1, 1, 1, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                     0, 0, 0, 0, 0, 0, 1, 2
                 ],
                 [
                     2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
                     1, 1, 1, 1, 1, 1, 1, 2
                 ]]
Пример #12
0
 def draw_map(self, screen):
     for y in range(len(self.map)):
         for x in range(len(self.map[y])):
             if timedelta(seconds=time.monotonic() -
                          self.map_start).seconds <= 10:
                 self.map[11][15] = 2
             if x == 15 and y == 11 and timedelta(
                     seconds=time.monotonic() -
                     self.map_start).seconds <= 10:
                 pygame.draw.line(screen, (255, 255, 255),
                                  (25 * x, y * 25 + 12),
                                  (25 * x + 25, y * 25 + 12), 5)
             elif self.map[y][x] == 1:
                 pygame.draw.rect(screen, constants.FIELD_COLOR,
                                  (x * 25, y * 25, 25, 25))
             elif self.map[y][x] == 0:
                 tmp = Seed()
                 tmp.draw(screen, (x * 25 + 12, y * 25 + 12))
             elif self.map[y][x] == 3:
                 tmp1 = BigSeed()
                 tmp1.draw(screen, (x * 25 + 12, y * 25 + 12))
     graph = pygame.draw.rect
     graph(screen, constants.BLACK, [155, 55, 465, 15], 0)
     graph(screen, constants.BLACK, [155, 55, 15, 190], 0)
     graph(screen, constants.BLACK, [605, 55, 15, 190], 0)
     graph(screen, constants.BLACK, [380, 55, 15, 90], 0)
     graph(screen, constants.BLACK, [380, 180, 15, 65], 0)
     graph(screen, constants.BLACK, [330, 180, 115, 15], 0)
     graph(screen, constants.BLACK, [155, 580, 465, 15], 0)
     graph(screen, constants.BLACK, [155, 380, 15, 200], 0)
     graph(screen, constants.BLACK, [605, 380, 15, 200], 0)
     graph(screen, constants.BLACK, [380, 380, 15, 65], 0)
     graph(screen, constants.BLACK, [330, 380, 115, 15], 0)
     graph(screen, constants.BLACK, [380, 480, 15, 65], 0)
     graph(screen, constants.BLACK, [330, 480, 115, 15], 0)
     graph(screen, constants.BLACK, [330, 330, 115, 15], 0)
     graph(screen, constants.BLACK, [530, 330, 90, 15], 0)
     graph(screen, constants.BLACK, [155, 330, 90, 15], 0)
     graph(screen, constants.BLACK, [530, 380, 90, 15], 0)
     graph(screen, constants.BLACK, [155, 380, 90, 15], 0)
     graph(screen, constants.BLACK, [530, 280, 90, 15], 0)
     graph(screen, constants.BLACK, [155, 280, 90, 15], 0)
     graph(screen, constants.BLACK, [530, 230, 90, 15], 0)
     graph(screen, constants.BLACK, [155, 230, 90, 15], 0)
     graph(screen, constants.BLACK, [230, 245, 15, 35], 0)
     graph(screen, constants.BLACK, [230, 345, 15, 35], 0)
     graph(screen, constants.BLACK, [530, 230, 15, 65], 0)
     graph(screen, constants.BLACK, [530, 330, 15, 65], 0)
     graph(screen, constants.BLACK, [205, 530, 140, 15], 0)
     graph(screen, constants.BLACK, [430, 530, 140, 15], 0)
     graph(screen, constants.BLACK, [280, 480, 15, 65], 0)
     graph(screen, constants.BLACK, [480, 480, 15, 65], 0)
     graph(screen, constants.BLACK, [280, 430, 65, 15], 0)
     graph(screen, constants.BLACK, [430, 430, 65, 15], 0)
     graph(screen, constants.BLACK, [230, 430, 15, 65], 0)
     graph(screen, constants.BLACK, [530, 430, 15, 65], 0)
     graph(screen, constants.BLACK, [230, 430, -25, 15], 0)
     graph(screen, constants.BLACK, [530, 430, 40, 15], 0)
     graph(screen, constants.BLACK, [170, 480, 25, 15], 0)
     graph(screen, constants.BLACK, [580, 480, 35, 15], 0)
     graph(screen, constants.BLACK, [205, 105, 40, 40], 0)
     graph(screen, constants.BLACK, [205, 180, 40, 15], 0)
     graph(screen, constants.BLACK, [530, 180, 40, 15], 0)
     graph(screen, constants.BLACK, [530, 105, 40, 40], 0)
     graph(screen, constants.BLACK, [280, 105, 65, 40], 0)
     graph(screen, constants.BLACK, [430, 105, 65, 40], 0)
     graph(screen, constants.BLACK, [280, 180, 15, 115], 0)
     graph(screen, constants.BLACK, [480, 180, 15, 115], 0)
     graph(screen, constants.BLACK, [280, 230, 65, 15], 0)
     graph(screen, constants.BLACK, [480, 230, -50, 15], 0)
     graph(screen, constants.BLACK, [280, 330, 15, 65], 0)
     graph(screen, constants.BLACK, [480, 330, 15, 65], 0)
     graph(screen, constants.BLACK, [330, 280, 15, 55], 0)
     graph(screen, constants.BLACK, [430, 280, 15, 55], 0)
     graph(screen, constants.BLACK, [330, 280, 40, 15], 0)
     graph(screen, constants.BLACK, [430, 280, -25, 15], 0)