Example #1
0
 def __init__(self):
     Board.__init__(self)
     Actions.__init__(self)
     Rules.__init__(self)
     self.players = {}
     self.turn = 0
     self.game_over = True
Example #2
0
 def __init__(self, interface, event_definition=None, event_format=None):
     """
     Initiate controller instance that is capable of listening to all events on specified input interface
     :param interface: STRING aka /dev/input/js0 or any other PS4 Dualshock controller interface.
                       You can see all available interfaces with a command "ls -la /dev/input/"
     """
     Actions.__init__(self)
     self.stop = False
     self.is_connected = False
     self.interface = interface
     self.debug = False  # If you want to see raw event stream, set this to True.
     self.event_definition = event_definition if event_definition else Event
     self.event_format = event_format if event_format else "LhBB"
     self.event_size = struct.calcsize(self.event_format)
     self.event_history = []
Example #3
0
    def __init__(self, parent, safetyMode="viewAccess", *args, **kwargs):
        wx.Frame.__init__(self, parent, *args, **kwargs)
        self.safetyMode = safetyMode
        ConfigData.__init__(self, *args, **kwargs)
        StatusBar.__init__(self, parent, *args, **kwargs)
        MenuBar.__init__(self, parent, *args, **kwargs)
        ToolBar.__init__(self, parent, *args, **kwargs)
        TreeContextMenu.__init__(self, parent, *args, **kwargs)

        # Some actions which are not relevant for any specific area
        Actions.__init__(self, *args, **kwargs)
        # The functions to enable printing
        Printing.__init__(self, parent, *args, **kwargs)
        # The functions to enable the help system
        Help.__init__(self, *args, **kwargs)
        # The functions to enable the about dialog
        About.__init__(self, *args, **kwargs)
        # The functions to enable the about dialog
        Settings.__init__(self, *args, **kwargs)
        #Set main splitter
        MainSplitter.__init__(self, *args, **kwargs)
        #Add the xml tree
        Document.__init__(self, *args, **kwargs)
        #Fill xml tree
        GetData.__init__(self, *args, **kwargs)
        #Add functions to modify the view of the xml tree
        ViewData.__init__(self, *args, **kwargs)
        #Add functions to edit the xml tree
        EditData.__init__(self, *args, **kwargs)

        #Copy example files: Comment this out if Template-Designer is in productive use.
        #self.getExamples()
        #Some kind of self check
        self.saveConfig()

        #Set panels
        #self.propertiesPanel = wx.Panel(self.mainSplitter)
        self.propertiesPanel = wx.ScrolledWindow(self.mainSplitter)
        self.templatePanel   = wx.Panel(self.mainSplitter)

        #Buttons on main frame
        self.applyButton       = wx.Button(self.propertiesPanel, 
                                           wx.ID_APPLY, 
                                           _(u"Apply changes"), 
                                           name="applyButton")
        self.defaultsButton    = wx.Button(self.propertiesPanel, 
                                           wx.ID_RESET, 
                                           _(u"Restore settings"), 
                                           name="defaultsButtons")

        expandAllButtonPath = self.documentTreeGraphics() + "/2downarrow.png"
        expandAllButtonBmp = wx.Image(expandAllButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
        self.expandAllButton   = wx.BitmapButton(self.templatePanel, 
                                                 -1, 
                                                 expandAllButtonBmp, 
                                                 name="expandButton")

        collapseAllButtonPath = self.documentTreeGraphics() + "/2uparrow.png"
        collapseAllButtonBmp = wx.Image(collapseAllButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
        self.collapseAllButton   = wx.BitmapButton(self.templatePanel, 
                                                 -1, 
                                                 collapseAllButtonBmp, 
                                                 name="collapseButton")

        addButtonPath = self.documentTreeGraphics() + "/filenew.png"
        addButtonBmp = wx.Image(addButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
        self.addButton   = wx.BitmapButton(self.templatePanel, 
                                                 -1, 
                                                 addButtonBmp, 
                                                 name="addButton")

        deleteButtonPath = self.documentTreeGraphics() + "/edit_delete.png"
        deleteButtonBmp = wx.Image(deleteButtonPath, wx.BITMAP_TYPE_PNG).ConvertToBitmap()
        self.deleteButton   = wx.BitmapButton(self.templatePanel, 
                                                 -1, 
                                                 deleteButtonBmp, 
                                                 name="deleteButton")

        """
        Set taskbar icon. If you remove this, do not forget to remove 
        the RemoveIcon() and Destroy() methods 
        in self.onCloseWindow()
        
        """
        self.taskBarIcon = wx.TaskBarIcon()
        iconPath = self.skinGraphics() + "/domtreeviewer.png"
        icon = wx.Icon(iconPath, wx.BITMAP_TYPE_PNG)
        self.taskBarIcon.SetIcon(icon, _(u"Template-Designer"))

        #Set titlebar icon
        self.SetIcon(icon)

        #Initiate the contents of the property panel
        self.pp = pp

        self.__doProperties()
        self.__doBindings()
        self.__doLayout()
        Safety(self)