コード例 #1
0
 def draw_preview(self, pad):
     # TODO: Create custom method draw_subtable in Table class instead of having to create a new object here
     if self._table.selection:
         pad.move(0, 0)
         output = self._structured_output()
         output_table = Table(output)
         printstr(pad, "Table {}x{} with {} filled cells".format(output_table.height, output_table.ncolumns,
                                                                 len(self._table.selection)),
                  curses.color_pair(7))
         output_table.draw(pad, lambda p, content: 0, margin=(1, 0))
コード例 #2
0
 def draw_preview(self, pad):
     # TODO: Create custom method draw_subtable in Table class instead of having to create a new object here
     if self._table.selection:
         pad.move(0, 0)
         output = self._structured_output()
         output_table = Table(output)
         printstr(
             pad, "Table {}x{} with {} filled cells".format(
                 output_table.height, output_table.ncolumns,
                 len(self._table.selection)), curses.color_pair(7))
         output_table.draw(pad, lambda p, content: 0, margin=(1, 0))
コード例 #3
0
 def __init__(self,
              behavior=BEHAVIOR_DEFAULT,
              ivy_address=IVY_ADDRESS_DEFAULT,
              static_obstacles_file=STATIC_OBSTACLES_FILE,
              lidar_mask_file=LIDAR_MASK_FILE,
              teensy_serial_path=TEENSY_SERIAL_PATH_DEFAULT):
     self.map = map.Map(self, static_obstacles_file, lidar_mask_file)
     self.table = Table(self)
     self.storages = {
         AtomStorage.Side.RIGHT: AtomStorage(robot, AtomStorage.Side.RIGHT),
         AtomStorage.Side.LEFT: AtomStorage(robot, AtomStorage.Side.LEFT)
     }
     self.communication = communication.Communication(teensy_serial_path)
     self.communication.start()
     self.io = IO(self)
     self.locomotion = Locomotion(self)
     self.ivy = ivy_robot.Ivy(self, ivy_address)
     if behavior == Behaviors.FSMMatch.value:
         from behavior.fsmmatch import FSMMatch
         self.behavior = FSMMatch(self)
     elif behavior == Behaviors.FSMTests.value:
         raise NotImplementedError("This behavior is not implemented yet !")
     elif behavior == Behaviors.Slave.value:
         from behavior.slave import Slave
         self.behavior = Slave(self)
     else:
         raise NotImplementedError("This behavior is not implemented yet !")
コード例 #4
0
ファイル: MainWidget.py プロジェクト: Saradey/CRUD-Python
    def __init__(self):
        super().__init__()
        self.__resourceManager = ResourceManager()
        self.__table_widget = QWidget()  #ВИДЖЕТ ТАБЛИЦЫ
        self.__addEntityWbdget = None  #ВИДЖЕТ для добавления сущностей
        self.__entityList = EntityList(
            self.__resourceManager)  #класс список сущностей для таблицы
        self.__grid_layout = QGridLayout()  # сетка
        self.__table = Table(self.__resourceManager)  #таблица
        self.__switcher = 0  #для переключения таблиц
        self.__functionalMain = FunctionalMain(
            self, self.__table
        )  #класс функционал, получает ссылку на главный виджет и работает с ним

        self.initUI()  #иницилизируем интерфейс
        pass
コード例 #5
0
    def print_table(self):
        table = Table()
        table.set_headers([
            'Id', 'Data', 'Type', 'Layer', 'Parent Id', 'Left Child Id',
            'Right Child Id'
        ])

        table_row_builder = []
        for node in self.in_order_traversal():
            table_row_builder.append([
                node.node_id, node.node_data, node.node_type, node.node_layer,
                node.parent_node.node_id if node.parent_node is not None else
                'None', node.left_node.node_id if node.left_node is not None
                else 'None', node.right_node.node_id
                if node.right_node is not None else 'None'
            ])

        table.set_data(table_row_builder)
        table.print_table()
コード例 #6
0
    def __init__(self):
        self.time_per_move = -1
        self.timebank = -1
        self.initial_big_blind = -1
        self.initial_stack = -1
        self.hands_per_blind_level = -1

        self.last_update = 0

        self.round = 0
        self.bet_round = None
        self.player_names = []
        self.players = {}
        self.me = None
        self.opponent = None
        self.on_button_player = None
        self.table = Table()
        self.pot = -1
        self.amount_to_call = -1
コード例 #7
0
ファイル: __init__.py プロジェクト: maschbd/pyramid_epfl
def add_routes(config):
    Form.add_pyramid_routes(config)
    Table.add_pyramid_routes(config)
    Menu.add_pyramid_routes(config)
    Canvas.add_pyramid_routes(config)
    Box.add_pyramid_routes(config)
コード例 #8
0
ファイル: MainWidget.py プロジェクト: Saradey/CRUD-Python
class MainWidget(QMainWindow):
    def __init__(self):
        super().__init__()
        self.__resourceManager = ResourceManager()
        self.__table_widget = QWidget()  #ВИДЖЕТ ТАБЛИЦЫ
        self.__addEntityWbdget = None  #ВИДЖЕТ для добавления сущностей
        self.__entityList = EntityList(
            self.__resourceManager)  #класс список сущностей для таблицы
        self.__grid_layout = QGridLayout()  # сетка
        self.__table = Table(self.__resourceManager)  #таблица
        self.__switcher = 0  #для переключения таблиц
        self.__functionalMain = FunctionalMain(
            self, self.__table
        )  #класс функционал, получает ссылку на главный виджет и работает с ним

        self.initUI()  #иницилизируем интерфейс
        pass

####################################функции 1 уровня

    def initUI(self):
        self.initTableWidget()

        self.setGeometry(400, 400, 1200, 500)
        self.setWindowTitle("Tour Operator : Airlands")
        pass

####################################функции 2 уровня
#создаем таблицу, к функции initUI

    def initTableWidget(self):
        self.__table_widget.setLayout(
            self.__grid_layout)  # добавляем в наш виджет таблицы сетку
        self.setCentralWidget(
            self.__table_widget)  # Устанавливаем центральный виджет таблицу
        self.GreatTable()  #3 уровень, функция создания таблицы данных
        pass

####################################функции 3 уровня
#функция создания таблицы данных, к функции initTableWidget

    def GreatTable(self):
        self.__entityList.GreatTable(
            self.__switcher)  #создаем список и загружаем из sql сущности
        self.__table.SetListEntityTable(
            self.__entityList)  #загружаем в табилицу все сущности
        self.__grid_layout.addWidget(self.__table.GreatGetTable(), 0,
                                     0)  # Добавляем таблицу в сетку
        pass

####################################сетеры

    def SetSwitcher(self, switcher):
        self.__switcher = switcher
        pass

    def SetAddEntityWidget(self, EntityWidget):
        self.__addEntityWbdget = EntityWidget
        pass

####################################гетеры

    def GetSwitcher(self):
        return self.__switcher

    def GetResourceManager(self):
        return self.__resourceManager
コード例 #9
0
ファイル: main.py プロジェクト: Tjorriemorrie/pokeraide
def table():
    click.echo('table')
    from table.table import Table
    table = Table()
    table.run()
コード例 #10
0
def setup_new_game(game_list, parameter, card_info):
    t = Table()
    humans = parameter[0]
    bots = parameter[1]

    index = 0
    for p in parameter[2:]:
        if p:
            for i in range(card_info[index][7].pile_setup(humans + bots)):
                card = card_info[index][7](
                    card_info[index][0], card_info[index][1],
                    card_info[index][2], card_info[index][3],
                    card_info[index][4], card_info[index][5],
                    card_info[index][6], None)
                if i == 0:
                    t.create_pile(card)
                else:
                    t.get_pile(t.get_pile_index_of_card(
                        card_info[index][0])).add_card(card)
            card_info[index][7].setup()
        index += 1

    for i in range(humans):
        human = Human(t)
        human.draw_deck(t, get_starting_deck())
        human.draw_hand()
        t.add_player(human)

    for i in range(bots):
        if i % 3 == 0:
            bot = Militia_Big_Money(t)
        elif i % 3 == 1:
            bot = Smithy_Big_Money(t)
        else:
            bot = Pure_Big_Money(t)
        bot.draw_deck(t, get_starting_deck())
        bot.draw_hand()
        t.add_player(bot)

    game_list.append(t)
コード例 #11
0
ファイル: tabs.py プロジェクト: jpginc/Autorize
    def draw(self):
        """  init autorize tabs
        """

        self._extender.logTable = Table(self._extender)

        #self.logTable.setAutoCreateRowSorter(True)

        tableWidth = self._extender.logTable.getPreferredSize().width        
        self._extender.logTable.getColumn("ID").setPreferredWidth(Math.round(tableWidth / 50 * 2))
        self._extender.logTable.getColumn("Method").setPreferredWidth(Math.round(tableWidth / 50 * 3))
        self._extender.logTable.getColumn("URL").setPreferredWidth(Math.round(tableWidth / 50 * 25))
        self._extender.logTable.getColumn("Orig. Length").setPreferredWidth(Math.round(tableWidth / 50 * 4))
        self._extender.logTable.getColumn("Modif. Length").setPreferredWidth(Math.round(tableWidth / 50 * 4))
        self._extender.logTable.getColumn("Unauth. Length").setPreferredWidth(Math.round(tableWidth / 50 * 4))
        self._extender.logTable.getColumn("Authorization Enforcement Status").setPreferredWidth(Math.round(tableWidth / 50 * 4))
        self._extender.logTable.getColumn("Authorization Unauth. Status").setPreferredWidth(Math.round(tableWidth / 50 * 4))

        self._extender.tableSorter = TableRowSorter(self._extender.tableModel)
        rowFilter = TableRowFilter(self._extender)
        self._extender.tableSorter.setRowFilter(rowFilter)
        self._extender.logTable.setRowSorter(self._extender.tableSorter)

        self._extender._splitpane = JSplitPane(JSplitPane.HORIZONTAL_SPLIT)
        self._extender._splitpane.setResizeWeight(1)
        self._extender.scrollPane = JScrollPane(self._extender.logTable)
        self._extender._splitpane.setLeftComponent(self._extender.scrollPane)
        self._extender.scrollPane.getVerticalScrollBar().addAdjustmentListener(AutoScrollListener(self._extender))

        copyURLitem = JMenuItem("Copy URL")
        copyURLitem.addActionListener(CopySelectedURL(self._extender))

        sendRequestMenu = JMenuItem("Send Original Request to Repeater")
        sendRequestMenu.addActionListener(SendRequestRepeater(self._extender, self._extender._callbacks, True))

        sendRequestMenu2 = JMenuItem("Send Modified Request to Repeater")
        sendRequestMenu2.addActionListener(SendRequestRepeater(self._extender, self._extender._callbacks, False))

        sendResponseMenu = JMenuItem("Send Responses to Comparer")
        sendResponseMenu.addActionListener(SendResponseComparer(self._extender, self._extender._callbacks))

        retestSelecteditem = JMenuItem("Retest selected request")
        retestSelecteditem.addActionListener(RetestSelectedRequest(self._extender))
        
        deleteSelectedItem = JMenuItem("Delete")
        deleteSelectedItem.addActionListener(DeleteSelectedRequest(self._extender))

        self._extender.menu = JPopupMenu("Popup")
        self._extender.menu.add(sendRequestMenu)
        self._extender.menu.add(sendRequestMenu2)
        self._extender.menu.add(sendResponseMenu)
        self._extender.menu.add(copyURLitem)
        self._extender.menu.add(retestSelecteditem)
        # self.menu.add(deleteSelectedItem) disabling this feature until bug will be fixed.
        message_editor = MessageEditor(self._extender)

        self._extender.tabs = JTabbedPane()
        self._extender._requestViewer = self._extender._callbacks.createMessageEditor(message_editor, False)
        self._extender._responseViewer = self._extender._callbacks.createMessageEditor(message_editor, False)

        self._extender._originalrequestViewer = self._extender._callbacks.createMessageEditor(message_editor, False)
        self._extender._originalresponseViewer = self._extender._callbacks.createMessageEditor(message_editor, False)

        self._extender._unauthorizedrequestViewer = self._extender._callbacks.createMessageEditor(message_editor, False)
        self._extender._unauthorizedresponseViewer = self._extender._callbacks.createMessageEditor(message_editor, False)        

        self._extender.tabs.addTab("Modified Request", self._extender._requestViewer.getComponent())
        self._extender.tabs.addTab("Modified Response", self._extender._responseViewer.getComponent())

        self._extender.tabs.addTab("Original Request", self._extender._originalrequestViewer.getComponent())
        self._extender.tabs.addTab("Original Response", self._extender._originalresponseViewer.getComponent())

        self._extender.tabs.addTab("Unauthenticated Request", self._extender._unauthorizedrequestViewer.getComponent())
        self._extender.tabs.addTab("Unauthenticated Response", self._extender._unauthorizedresponseViewer.getComponent())        

        self._extender.tabs.addTab("Configuration", self._extender.pnl)
        self._extender.tabs.setSelectedIndex(6)
        self._extender._splitpane.setRightComponent(self._extender.tabs)
コード例 #12
0
ファイル: main.py プロジェクト: Tjorriemorrie/pokeraide
def table():
    click.echo('table')
    from table.table import Table
    table = Table()
    table.run()