コード例 #1
0
def WeeklyComicReleases(books):
	try:
                MainDisplay.ComicRack = ComicRack
		m = MainDisplay.MainDisplay()
		m.ShowDialog()
		m.Dispose()
	except Exception, e:
		print str(e)
		print type(e)
コード例 #2
0
    def __init__(self):
        self.l_btn = cf.l_btn
        self.clicks = cf.clicks
        self.timeout = 0.5  # how long can pass between two clicks to consider them part of the same event
        self.short_click = 0.65  # length of a single click
        self.long_click = 1.0  # length of a long click
        self.very_long_click = 4.0  # length of a veeeery long click
        self.display = m.Display()
        self.controll = C.CONTROLL()
        self.GPIO_setup()

        self.controll.get_player()
        self.controll.add_event_callbakcs()
        self.vlc_player = self.controll.vlc_player
        ap.play(self.vlc_player)
コード例 #3
0
    def start(self):
        self._display = MainDisplay.MainDisplay()
        self._message = "Howdy"
        self._connection.open_connection()
        
        while not self._account.is_logged_in():
            try:
                session_info = self._display.retrieve_user_info(self._message)
                self._account.set_username(session_info[0])
                self._account.set_password(session_info[1])
                game_choice = session_info[2]
                
                
                #################### DEBUG ##########################
                game_choice = ("generic")
                #print 'user info entered'
                #####################################################
                
                
                response = self._account.login(self._connection, game_choice)
                player_id = int(response[0])
                status = response[1]
                print 'bgc received messages 1 and 3'
                print 'player_id: ',player_id
                print 'status: ',status
                
                if Account.FAIL_KEYWORD not in status.upper():
                    self._account.set_logged_in(True)
                    player_num = int(self._connection.get_response())
                    print 'bgc received message 4'
                    print 'player_num: ',player_num
                else: 
                    self._message = status
            except Exception as e:
                print e
                sys.exit()

        self._game, self._display = self._board_game_factory(game_choice)
        self._game.set_my_player_number(player_num)
        print 'my player number is(bgc): ', self._game.get_my_player_number()
        self._game.set_my_player_id(player_id)

        ################### DEBUG ######################
        #Until message 5 is implemented in standard way#
        #self._game.set_my_turn(True)
        ################################################
        
        self._run_game()
コード例 #4
0
ファイル: MainScreen.py プロジェクト: ImMilesahead/PiCar2
class MainScreen:
    def __init__(self, skrn, screenManager):
        self.skrn = skrn
        self.screenManager = screenManager
    
        self.mainDisplay = MainDisplay(skrn)

    def draw(self):
        # Draw Time
        self.mainDisplay.draw()
        
    def logic(self, deltaTime):
        self.mainDisplay.logic(deltaTime)


    def event(self, event):
        self.mainDisplay.event(event)
コード例 #5
0
def mainDisplay():
    #call('sudo pigpiod', shell=True)
    m = MD.Display()
    while True:
        m.main()
コード例 #6
0
from tkinter import Tk
import MainDisplay
from PyQt5 import QtWidgets

if __name__ == '__main__':
    import sys

    trackApp = QtWidgets.QApplication(sys.argv)
    trackWindow = QtWidgets.QMainWindow()
    track = trackModel.trackModel()
    track.setupUi(trackWindow)
    track.importTrack()

    trainCApp = QtWidgets.QApplication(sys.argv)
    trainCWindow = QtWidgets.QMainWindow()
    trainC = MainDisplay.Ui_LoginWindow()

    trainApp = QtWidgets.QApplication(sys.argv)
    trainWindow = QtWidgets.QMainWindow()
    train = trainModel.Ui_MainWindow()
    track.setTrainModel(train)
    train.trackModelInstance(track)
    train.trainControllerInstance(trainC)
    train.setupUi(trainWindow)

    trainC.setupUi1(trainCWindow)
    trainC.importTrain(train)

    ctc = t1_updated.CTCOFFICE()

    trackCApp = QtWidgets.QApplication(sys.argv)
コード例 #7
0
    def __init__(self, master, hide_vcdat=0, stdout=0):

        Tkinter.Frame.__init__(self, master)

        self._master = master
        self._stdout = stdout
        self._hide_vcdat = hide_vcdat
        self._about = 0
        self._select = 0
        self._idleEditor = 0
        self._threadVCDAT = 0
        master.title('CDAT Demo - Main Menu')

        #-----------------------------------
        # Create and install the MenuBar.
        #-----------------------------------

        self._menuBar = Pmw.MainMenuBar(master)
        master.config(menu=self._menuBar)

        # Add File
        self._menuBar.addmenu('File', '')

        # Add File->Exit
        self._menuBar.addmenuitem('File',
                                  'command',
                                  label='Exit',
                                  command=sys.exit)

        # Add Applications
        self._menuBar.addmenu('Applications', '')

        # Add Applications->...
        applications = [('Earth Sciences', self._cbackEarthSci),
                        ('Engineering', self._cbackEngineering),
                        ('Air Pollution', self._cbackAirPollution)]
        for lbl, cmd in applications:
            self._menuBar.addmenuitem('Applications',
                                      'command',
                                      label=lbl,
                                      command=cmd)

        # Add Features
        self._menuBar.addmenu('Features', '')

        # Add Features->...
        features = [('Visualization', self._cbackVisual),
                    ('Diagnostics', self._cbackDiagnostics),
                    ('Xmgrace', self._cbackXmgrace),
                    ('Data Analysis', self._cbackDataAnalysis),
                    ('Application Development', self._cbackAppDevel)]

        for lbl, cmd in features:
            self._menuBar.addmenuitem('Features',
                                      'command',
                                      label=lbl,
                                      command=cmd)

        if not self._hide_vcdat:
            # Add Run CDAT
            self._menuBar.addmenu('VCDAT', '')

            # Add Run CDAT->...
            runcdat = [('VCDAT (Lite)', self._cbackVCDATLite),
                       ('VCDAT (Full)', self._cbackVCDATFull)]
            for lbl, cmd in runcdat:
                self._menuBar.addmenuitem('VCDAT',
                                          'command',
                                          label=lbl,
                                          command=cmd)

        # Add Help
        self._menuBar.addmenu('Help', '')

        # Add Help->About
        self._menuBar.addmenuitem('Help',
                                  'command',
                                  label='About',
                                  command=self._aboutDialog)

        # Create buttons.
        if not self._hide_vcdat:
            background_fname = os.path.join(sys.exec_prefix, 'bin/images',
                                            'main_background.gif')
            buttons = [('Earth Sciences', 1, 23, self._cbackEarthSci,
                        self._onBtnEarthSciEnter),
                       ('Engineering', 1, 24, self._cbackEngineering,
                        self._onBtnEngineeringEnter),
                       ('Air Pollution', 1, 25, self._cbackAirPollution,
                        self._onBtnAirPollutionEnter),
                       ('CDAT Overview', 1, 31, self._cbackCDATOverview,
                        self._onBtnCDATOverviewEnter),
                       ('Run VCDAT (Lite)', 5, 28, self._cbackVCDATLite,
                        self._onBtnVCDATLiteEnter),
                       ('Run VCDAT (Full)', 5, 29, self._cbackVCDATFull,
                        self._onBtnVCDATFullEnter),
                       ('Visualization', 9, 27, self._cbackVisual,
                        self._onBtnVisualEnter),
                       ('Diagnostics', 9, 28, self._cbackDiagnostics,
                        self._onBtnDiagnosticsEnter),
                       ('Xmgrace', 9, 29, self._cbackXmgrace,
                        self._onBtnXmgraceEnter),
                       ('Data Analysis', 9, 30, self._cbackDataAnalysis,
                        self._onBtnDataAnalysisEnter),
                       ('Application Development', 9, 31, self._cbackAppDevel,
                        self._onBtnAppDevelEnter)]
        else:
            background_fname = os.path.join(sys.exec_prefix, 'bin/images',
                                            'main_background2.gif')
            buttons = [('Earth Sciences', 3, 23, self._cbackEarthSci,
                        self._onBtnEarthSciEnter),
                       ('Engineering', 3, 24, self._cbackEngineering,
                        self._onBtnEngineeringEnter),
                       ('Air Pollution', 3, 25, self._cbackAirPollution,
                        self._onBtnAirPollutionEnter),
                       ('CDAT Overview', 3, 27, self._cbackCDATOverview,
                        self._onBtnCDATOverviewEnter),
                       ('Visualization', 8, 23, self._cbackVisual,
                        self._onBtnVisualEnter),
                       ('Diagnostics', 8, 24, self._cbackDiagnostics,
                        self._onBtnDiagnosticsEnter),
                       ('Xmgrace', 8, 25, self._cbackXmgrace,
                        self._onBtnXmgraceEnter),
                       ('Data Analysis', 8, 26, self._cbackDataAnalysis,
                        self._onBtnDataAnalysisEnter),
                       ('Application Development', 8, 27, self._cbackAppDevel,
                        self._onBtnAppDevelEnter)]

        # Create a display frame container.
        self._display = Pmw.ScrolledFrame(master)
        self._display.pack(expand=1, fill='both')

        # Create the Main Menu.
        import MainDisplay
        self._curDisplay = MainDisplay.MainDisplay(self._display.interior(),
                                                   background_fname, buttons,
                                                   self._onBtnLeave)
        self._curDisplay.pack(expand=1, fill='both')
        self._curDisplay.update_idletasks()

        # Save the Main Menu display; will be used when
        # user clicks "Return to Main Menu" button.
        self._mainDisplay = self._curDisplay

        self._display.component('borderframe')['bd'] = 0
        self._display.component(
            'clipper')['width'] = self._curDisplay.getWidth() + 4
        self._display.component(
            'clipper')['height'] = self._curDisplay.getHeight() + 4

        # Create status display.
        self._statusBox = Pmw.Group(master, tag_pyclass=None)
        self._statusBox.pack(fill='x', padx=3, pady=2)
        self._statusText = Tkinter.Label(self._statusBox.interior())
        self._statusText.pack(side='left', padx=5, pady=2)
        self._setDefaultStatusText()
        self._setStatusText()

        # Demo sets configuration.
        self._demoNames = {
            'EARTH_SCI': ['Earth Sciences', 'earth_sciences.gif', '', '', ''],
            'ENGINEERING':
            ['Engineering', 'engineering.gif', 'engineering_ss.gif', '', ''],
            'AIR_POLLUTION':
            ['Air Pollution', 'air_pollution.gif', '', '', ''],
            'CDAT_OVERVIEW':
            ['Overview', 'cdat_overview.gif', 'cdat_overview_ss.gif', '', ''],
            'VISUAL': ['Visualization', 'visualization.gif', '', '', ''],
            'DIAGNOSTICS': ['Diagnostics', 'diagnostics.gif', '', '', ''],
            'XMGRACE': ['Xmgrace', 'xmgrace.gif', '', '', ''],
            'DATA_ANALYSIS':
            ['Data Analysis', 'data_analysis.gif', '', '', ''],
            'APP_DEVEL': [
                'Application Development', 'application_development.gif', '',
                '', ''
            ],
        }

        # Initialize demo sets to zero.
        for val in self._demoNames.values():
            name = val[0]
            self._demos[name] = 0
コード例 #8
0
ファイル: MainScreen.py プロジェクト: ImMilesahead/PiCar2
 def __init__(self, skrn, screenManager):
     self.skrn = skrn
     self.screenManager = screenManager
 
     self.mainDisplay = MainDisplay(skrn)