def __init__(self):
        """
        This starts the Tk framework up, instantiates the Model (a Counter object), instantiates the View (a MyFrame object), and starts the event loop that waits for the user to press a Button on the View.
        """

        root = tkinter.Tk()
        self.model = Counter.Counter()
        self.view = MyFrame.MyFrame(self)
        self.view.mainloop()
        root.destroy()
    def OnInit(self):
        wx.InitAllImageHandlers()
        frame = MyFrame.MyFrame(None, -1, "")
        self.SetTopWindow(frame)
        frame.Show()

        #for an easy dev
        #if sFile and os.path.exists(sFile):
        if self.sFile: frame.loadXML(self.sFile)
        #		if os.path.exists("launiversitat20_noDS.xml"): frame.loadXML("brill92.fn.xml")
        #		if os.path.exists("launiversitat20.xml"): frame.loadXML("launiversitat20.xml")
        #		if os.path.exists("launiversitat1-5.xml"): frame.loadXML("launiversitat1-5.xml")
        return 1
Esempio n. 3
0
    def OnInit(self):
        # Import Data
        self.mainFrame    = MyFrame(parent=None, id=-1, title="CBS Top 300")
        self.players1to8  = MyFrame(parent=None, id=-1, title="Owners 1-8")
        self.players9to16 = MyFrame(parent=None, id=-1, title="Owners 9-16")
        self.players      = self.import_players()
        self.owners       = self.import_owners()

        # Build GUI
        self.mainFrame.build_main_frame(self.players, self.owners)
        self.mainFrame.Show(True)
        self.SetTopWindow(self.mainFrame)

        self.players1to8.build_1_to_8(self.owners[:8])
        self.players1to8.Show(True)
        self.SetTopWindow(self.players1to8)

        self.players9to16.build_9_to_16(self.owners[8:len(self.owners)])
        self.players9to16.Show(True)
        self.SetTopWindow(self.players9to16)

        return True
Esempio n. 4
0
class MyFrame(MyFrame.MyFrame):
    def getOutpath(self, event):
        dlg = wx.DirDialog(self, 'output', os.getcwd())
        if dlg.ShowModal() == wx.ID_OK:

            self.m_textCtrl3.write(dlg.GetPath() + '\n')

            os.chdir(dlg.GetPath())
        dlg.Destroy()

    def gochange(self, event):

        dlg = wx.FileDialog(self, 'Change', os.getcwd(), style=wx.FD_MULTIPLE)
        if dlg.ShowModal() == wx.ID_OK:

            print(dlg.GetPaths())
            for file in dlg.GetPaths():
                dealpdf(file)

        dlg.Destroy()
        self.m_textCtrl3.write('done\n')


if __name__ == '__main__':

    app = wx.App()

    main_win = MyFrame(None)
    main_win.Show()

    app.MainLoop()
Esempio n. 5
0
""" 
The main program creates a MyFrame object and waits for the user to push a Button on it.
"""

import tkinter
import MyFrame

if __name__ == "__main__":
    root = tkinter.Tk()  # starts up the tkinter framework
    view = MyFrame.MyFrame()
    view.mainloop()  # starts the event loop
    root.destroy()  # kills the event loop and takes the Frame down
Esempio n. 6
0
import wx
import MyFrame

app = wx.App()

main_frame = MyFrame.MainFrame()

app.MainLoop()
    sys.exit(1)


if __name__ == "__main__":
    deco.setEncoding(sEncoding)
    sFile = None
    print sys.argv

    try:
        sPath = sys.argv[1]

        try:
            sFile = sys.argv[2]
            if not os.path.exists(sFile) and len(sys.argv) > 3:
                #maybe we have a space in the file name... :-( and it is a mess with windows and .bat
                if os.path.exists(sys.argv[2] + " " + sys.argv[3]):
                    sFile = sys.argv[2] + " " + sys.argv[3]
        except IndexError:
            pass
    except IndexError:
        sConfigFileName = "wxvisu.ini"
        #try to find da config.ini file
        sPath = lookForConfig(
            sConfigFileName,
            [".", os.path.dirname(os.path.abspath(sys.argv[0]))])

    MyFrame.setConfigFile(sPath)
    MyFrame.setEncoding(sEncoding)
    app = MyApp(0, sFile)
    app.MainLoop()
Esempio n. 8
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.main = MyFrame.MyFrame(None, -1, '')
     self.main.Show()
     self.SetTopWindow(self.main)
     return 1
Esempio n. 9
0
class MyApp(wx.App):
    def OnInit(self):
        # Import Data
        self.mainFrame    = MyFrame(parent=None, id=-1, title="CBS Top 300")
        self.players1to8  = MyFrame(parent=None, id=-1, title="Owners 1-8")
        self.players9to16 = MyFrame(parent=None, id=-1, title="Owners 9-16")
        self.players      = self.import_players()
        self.owners       = self.import_owners()

        # Build GUI
        self.mainFrame.build_main_frame(self.players, self.owners)
        self.mainFrame.Show(True)
        self.SetTopWindow(self.mainFrame)

        self.players1to8.build_1_to_8(self.owners[:8])
        self.players1to8.Show(True)
        self.SetTopWindow(self.players1to8)

        self.players9to16.build_9_to_16(self.owners[8:len(self.owners)])
        self.players9to16.Show(True)
        self.SetTopWindow(self.players9to16)

        return True

    def import_players(self, workbookName='players.xls'):
        players = []
        workbook = xlrd.open_workbook(workbookName)
        sheet = workbook.sheet_by_index(0)
        for rownum in range(1,sheet.nrows):
            firstName = ""
            lastName = ""
            team = ""
            position = ""
            row = sheet.row_values(rownum)
            testBlanks = ""
            for x in range(len(row)):
                testBlanks += row[x]
            if testBlanks != "": # If the row is blank, ignore it
                name = string.split(row[0],', ')
                if len(name) != 2:
                    print "Name formatting error in row " + str(rownum+1)
                    print row
                else:
                    firstName = string.strip(name[1])
                    lastName = string.strip(name[0])
                    team = row[1]
                    position = row[2]
                    players.append(Player(firstName,lastName,team,position))
        return players

    def import_owners(self, workbookName='owners.xls'):
        owners = []
        workbook = xlrd.open_workbook(workbookName)
        sheet = workbook.sheet_by_index(0)
        for rownum in range(1,sheet.nrows):
            name = ""
            cash = 0
            bonus = 0
            row = sheet.row_values(rownum)
            testBlanks = ""
            for x in range(len(row)):
                testBlanks += str(row[x])
            if testBlanks != "": # If the row is blank, ignore it
                name = row[0]
                if (isNum(row[1]) & isNum(row[2])):
                    cash = row[1]
                    bonus = row[2]
                    if rownum <= 8:
                        owners.append(Owner(self.players1to8,name,bonus,cash))
                    else:
                        owners.append(Owner(self.players9to16,name,bonus,cash))
                    #print owners[-1]
                else:
                    print "Invalid numbers on line " + rownum
        return owners