Example #1
0
	def OnCreateBucket(self,event):
		"""Creates new bucket"""
		inputBox = wx.TextEntryDialog(self,"Enter the name of the bucket","GS")
		if inputBox.ShowModal() == wx.ID_OK:
			bucketName = inputBox.GetValue()
			m = gs.createBucket(bucketName)
			wx.MessageBox(str(m[0])+"\n"+str(m[1]),"Response")
			self.bkts = gs.getBuckets()
			if self.bkts:		
				for x in self.bkts: self.bktList.InsertStringItem(0,x)
Example #2
0
 def OnCreateBucket(self, event):
     """Creates new bucket"""
     inputBox = wx.TextEntryDialog(self, "Enter the name of the bucket",
                                   "GS")
     if inputBox.ShowModal() == wx.ID_OK:
         bucketName = inputBox.GetValue()
         m = gs.createBucket(bucketName)
         wx.MessageBox(str(m[0]) + "\n" + str(m[1]), "Response")
         self.bkts = gs.getBuckets()
         if self.bkts:
             for x in self.bkts:
                 self.bktList.InsertStringItem(0, x)
Example #3
0
	def __init__(self,parent,title):
		#Initial stuff
                self.botoFrame = BotoSettings(None,"BotoSettings")
		wx.Frame.__init__(self,parent,title=title,size=(700,600))
		self.DragAcceptFiles(True)
		self.Bind(wx.EVT_DROP_FILES,self.OnDrop) #Bind OnDrop to handle dropped files
               
		#The Bucket List
		self.bktList = wx.ListCtrl(parent=self,style=wx.LC_REPORT|wx.SUNKEN_BORDER,size=(200,100),pos=wx.Point(5,5))
                self.bktList.Bind(wx.EVT_LIST_ITEM_SELECTED,self.OnListBox)
		self.bktList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK,self.OnRightClickForBucketList)
		self.bktList.InsertColumn(0,"Buckets")
		self.bkts = gs.getBuckets()
		if self.bkts:
			for x in self.bkts: self.bktList.InsertStringItem(0,x)

		#The Object/File list 
                self.fileList = wx.ListCtrl(parent=self,size=(400,100),pos=wx.Point(210,5))
		self.fileList.InsertColumn(0,"Objects")
		self.fileList.SetToolTip(wx.ToolTip("Right click for options"))
		#self.fileList.Bind(wx.EVT_LIST_ITEM_SELECTED,self.OnDownload)
		self.fileList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK,self.OnRightClickForObjectList)

		#The Local Directory structure
		self.dirCtrl = wx.GenericDirCtrl(self,size=(200,200),pos=wx.Point(5,120))
		self.dir_tree = self.dirCtrl.GetTreeCtrl()
		self.dir_tree.SetWindowStyle(self.dir_tree.GetWindowStyle() | wx.TR_MULTIPLE) #TR_MULTIPLE for multiple selections

		#Upload & Refresh Buttons
		self.uploadButton = wx.Button(self,label="Upload",size=(100,50),pos=wx.Point(250,200))
		self.uploadButton.Bind(wx.EVT_BUTTON,self.OnUpload)
		self.refreshButton = wx.Button(self,label="Refresh",size=(100,50),pos = wx.Point(250,270))
		self.refreshButton.Bind(wx.EVT_BUTTON,self.OnRefresh)

		self.CreateStatusBar() #Create a status bar
        
		#Setting up the menu
		fileMenu = wx.Menu()
		menuItem = fileMenu.Append(wx.ID_ANY,"Boto&Settings","View/Modify BotoSettings")
		self.Bind(wx.EVT_MENU,self.OnBoto,menuItem)
		fileMenu.AppendSeparator()
		menuItem = fileMenu.Append(wx.ID_ANY,"&About","About this app")
		self.Bind(wx.EVT_MENU,self.OnAbout, menuItem)
		menuItem = fileMenu.Append(wx.ID_EXIT,"E&xit","Get outta here!")
		self.Bind(wx.EVT_MENU,self.OnExit,menuItem)

		#Setting up the menu bar
		menuBar = wx.MenuBar()
		menuBar.Append(fileMenu,"&File")
		self.SetMenuBar(menuBar)
		
		self.Show(True)
Example #4
0
    def __init__(self, parent, title):
        #Initial stuff
        self.botoFrame = BotoSettings(None, "BotoSettings")
        wx.Frame.__init__(self, parent, title=title, size=(700, 600))
        self.DragAcceptFiles(True)
        self.Bind(wx.EVT_DROP_FILES,
                  self.OnDrop)  #Bind OnDrop to handle dropped files

        #The Bucket List
        self.bktList = wx.ListCtrl(parent=self,
                                   style=wx.LC_REPORT | wx.SUNKEN_BORDER,
                                   size=(200, 100),
                                   pos=wx.Point(5, 5))
        self.bktList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnListBox)
        self.bktList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK,
                          self.OnRightClickForBucketList)
        self.bktList.InsertColumn(0, "Buckets")
        self.bkts = gs.getBuckets()
        if self.bkts:
            for x in self.bkts:
                self.bktList.InsertStringItem(0, x)

    #The Object/File list
        self.fileList = wx.ListCtrl(parent=self,
                                    size=(400, 100),
                                    pos=wx.Point(210, 5))
        self.fileList.InsertColumn(0, "Objects")
        self.fileList.SetToolTip(wx.ToolTip("Right click for options"))
        #self.fileList.Bind(wx.EVT_LIST_ITEM_SELECTED,self.OnDownload)
        self.fileList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK,
                           self.OnRightClickForObjectList)

        #The Local Directory structure
        self.dirCtrl = wx.GenericDirCtrl(self,
                                         size=(200, 200),
                                         pos=wx.Point(5, 120))
        self.dir_tree = self.dirCtrl.GetTreeCtrl()
        self.dir_tree.SetWindowStyle(
            self.dir_tree.GetWindowStyle()
            | wx.TR_MULTIPLE)  #TR_MULTIPLE for multiple selections

        #Upload & Refresh Buttons
        self.uploadButton = wx.Button(self,
                                      label="Upload",
                                      size=(100, 50),
                                      pos=wx.Point(250, 200))
        self.uploadButton.Bind(wx.EVT_BUTTON, self.OnUpload)
        self.refreshButton = wx.Button(self,
                                       label="Refresh",
                                       size=(100, 50),
                                       pos=wx.Point(250, 270))
        self.refreshButton.Bind(wx.EVT_BUTTON, self.OnRefresh)

        self.CreateStatusBar()  #Create a status bar

        #Setting up the menu
        fileMenu = wx.Menu()
        menuItem = fileMenu.Append(wx.ID_ANY, "Boto&Settings",
                                   "View/Modify BotoSettings")
        self.Bind(wx.EVT_MENU, self.OnBoto, menuItem)
        fileMenu.AppendSeparator()
        menuItem = fileMenu.Append(wx.ID_ANY, "&About", "About this app")
        self.Bind(wx.EVT_MENU, self.OnAbout, menuItem)
        menuItem = fileMenu.Append(wx.ID_EXIT, "E&xit", "Get outta here!")
        self.Bind(wx.EVT_MENU, self.OnExit, menuItem)

        #Setting up the menu bar
        menuBar = wx.MenuBar()
        menuBar.Append(fileMenu, "&File")
        self.SetMenuBar(menuBar)

        self.Show(True)