def add_object_dir(self, event):
        """
        Event function. This function is called when we select
        create new object in the main menu.
        """
        # Change the notebook selection to the object tab.
        self.nb.SetSelection(1)

        # Create object add dialog and show it modal.
        dialog = AddNewObjectDialogDir(self)
        dialog.ShowModal()
        if dialog.ReturnCode == wx.ID_OK:
            path = str(dialog.path)
            dirList=os.listdir(path)
            for fname in dirList:
                # Why are we only allowing .jpg.
                if fname.lower().endswith('.jpg'):
                    new_object = Object(path + '/' + fname)
                    try:
                        new_object.create()
                    except:
                        print '-- error while creating new object:', fname
                    
                    for tag in dialog.addedTags:
                        objectCubeService.add_tag_to_object(tag.tagSetId, tag.id, new_object.id)
 
            # refresh the object list.
            self.objectPanel.refresh_object_list()
    def add_object_dir(self, event):
        """
        Event function. This function is called when we select
        create new object in the main menu.
        """
        # Change the notebook selection to the object tab.
        self.nb.SetSelection(1)

        # Create object add dialog and show it modal.
        dialog = AddNewObjectDialogDir(self)
        dialog.ShowModal()
        if dialog.ReturnCode == wx.ID_OK:
            path = str(dialog.path)
            dirList = os.listdir(path)
            for fname in dirList:
                # Why are we only allowing .jpg.
                if fname.lower().endswith('.jpg'):
                    new_object = Object(path + '/' + fname)
                    try:
                        new_object.create()
                    except:
                        print '-- error while creating new object:', fname

                    for tag in dialog.addedTags:
                        objectCubeService.add_tag_to_object(
                            tag.tagSetId, tag.id, new_object.id)

            # refresh the object list.
            self.objectPanel.refresh_object_list()
示例#3
0
 def on_button_ok(self, event):
     if self.selected_tag is not None:
         for tag in self.selected_tagset.getTags():
             if tag.valueAsString() == self.selected_tag:
                 objectCubeService.add_tag_to_object(self.selected_tagset.id, tag.id, self.object_id)
                 break
         self.EndModal ( wx.ID_OK )
         self.Destroy()
     else:
         print 'MESSAGEBOX: VALJA TAG FYRST'
示例#4
0
 def on_button_ok(self, event):
     if self.selected_tag is not None:
         for tag in self.selected_tagset.getTags():
             if tag.valueAsString() == self.selected_tag:
                 objectCubeService.add_tag_to_object(
                     self.selected_tagset.id, tag.id, self.object_id)
                 break
         self.EndModal(wx.ID_OK)
         self.Destroy()
     else:
         print 'MESSAGEBOX: VALJA TAG FYRST'
    def add_object(self, event):
        """
        Event function. This function is called when we select
        create new object in the main menu.
        """
        # Change the notebook selection to the object tab.
        self.nb.SetSelection(1)

        # Create object add dialog and show it modal.
        dialog = AddNewObjectDialog(self, -1, 'Add new object')
        dialog.ShowModal()
        if dialog.ReturnCode == wx.ID_OK:
            object_url = str(dialog.dirname + '/' + dialog.filename)
            new_object = Object(object_url)
            try:
                new_object.create()
            except:
                print '-- error while creating new object.'
                
            for tag in dialog.addedTags:
                objectCubeService.add_tag_to_object(tag.tagSetId, tag.id, new_object.id)

            self.objectPanel.refresh_object_list()
    def add_object(self, event):
        """
        Event function. This function is called when we select
        create new object in the main menu.
        """
        # Change the notebook selection to the object tab.
        self.nb.SetSelection(1)

        # Create object add dialog and show it modal.
        dialog = AddNewObjectDialog(self, -1, 'Add new object')
        dialog.ShowModal()
        if dialog.ReturnCode == wx.ID_OK:
            object_url = str(dialog.dirname + '/' + dialog.filename)
            new_object = Object(object_url)
            try:
                new_object.create()
            except:
                print '-- error while creating new object.'

            for tag in dialog.addedTags:
                objectCubeService.add_tag_to_object(tag.tagSetId, tag.id,
                                                    new_object.id)

            self.objectPanel.refresh_object_list()