Callback for the shot open button

        :returns: None
        :rtype: None
        :raises: None
978690
def asset_save_callback(self, *args, **kwargs):
        
        tasksel = self.browser.assetbrws.selected_indexes(2)
        if not tasksel or not tasksel[0].isValid():
            self.statusbar.showMessage('No task selected! Cannot save!')
            return

        taskitem = tasksel[0].internalPointer()
        task = taskitem.internal_data()
        rtype = djadapter.RELEASETYPES['work']
        descriptor = self.asset_descriptor_le.text()
        if not self.check_selection_for_save(task, rtype, descriptor):
            return

        tfi = TaskFileInfo.get_next(task=task, releasetype=rtype,
                                    typ=self._filetype, descriptor=descriptor)
        self._save_tfi(tfi, asset=True)
1150590
function( index, callback ) {

        var scope = this;

        var shot = scope.shots[ index|0 ];

        if( ! shot ) {

            throw new Error(
                "Shot number " + index + " not found"
            );

            return;

        }

        return shot;

    }
544163
def open(self):
        """"""
        url = self.url
        try:
            request = urllib.request.Request(url)
            handle = urllib.request.build_opener()
        except IOError:
            return None
        return (request, handle)
327337
def shot_taskfile_sel_changed(self, tf):
        
        self.shot_open_pb.setEnabled(bool(tf))
        # only allow new, if the releasetype is work
        # only allow new, if there is a shot. if there is a shot, there should always be a task.
        enablenew = bool(self.browser.shotbrws.selected_indexes(1)) and self.browser.get_releasetype() == djadapter.RELEASETYPES['work']
        self.shot_save_pb.setEnabled(enablenew)
        self.shot_descriptor_le.setEnabled(enablenew)
        self.shot_comment_pte.setEnabled(enablenew)
        self.update_descriptor_le(self.shot_descriptor_le, tf)
821790
def btn_press_event(self, widget, event):
        
        if event.type == Gdk.EventType.BUTTON_PRESS:
            if event.button.button == 1:
                widget.popup(None, None, None, None,
                             event.button.button, event.time)
            return True
        return False
332748
function( shot, callback ) {

        var scope = this;

        if( typeof( shot ) === "number" ) {

            shot = scope.getShot( shot );

        }

        if( shot.location ) {

            FS.readFile( shot.location, function( err, data ) {

                callback( err, data );

            });

        } else if( ! shot.data ) {

            callback(
                new Error( "Shot not valid" )
            );

        } else {

            callback( null, shot.data );

        }

    }
1314741
def shot(self, **kwargs):
        # type: (Any) -> str
        

        kwargs["mon"] = kwargs.get("mon", 1)
        return next(self.save(**kwargs))
875126
def click(self, force_no_call=False, milis=None):
        

        if self.clicked:
            return False

        if not force_no_call and self.flags & self.CALL_ON_PRESS:
            if self.flags & self.THREADED_CALL:
                start_new_thread(self.func, ())
            else:
                self.func()

        super().click()

        if milis is not None:
            start_new_thread(self.release, (), {'milis': milis})
745223
def capture(self, *args, **kwargs):
        
        if not self.is_enabled():
            return

        data = self.build_msg(*args, **kwargs)

        future = self.send(callback=kwargs.get('callback', None), **data)

        return (data['event_id'], future)
596239
function( callback ) {

        var scope = this;

        if( ! scope.shots.length ) {

            callback && callback( new Error( "Camera has no last shot" ) );

        }

        scope.getBase64( scope.shots.length - 1, callback );

    }
1092787
def shot_view_task(self, ):
        
        if not self.cur_shot:
            return

        i = self.shot_task_tablev.currentIndex()
        item = i.internalPointer()
        if item:
            task = item.internal_data()
            self.view_task(task)
787859
def undobutton_action(self):
        
        if len(self.history) > 1:
            old = self.history.pop(-1)
            self.selection_array = old
            self.mask.set_data(old)
            self.fig.canvas.draw_idle()
1061304
def on_open(self):
        
        filename, filter = QtWidgets.QFileDialog.getOpenFileName(
            self, _('Open'))
        if filename:
            self.open_file(filename)
1193758
def on_press_key(key, callback, suppress=False):
    
    return hook_key(key, lambda e: e.event_type == KEY_UP or callback(e), suppress=suppress)
650468
def single_shot(self, check_status=True, **kwargs):
        
        self.check_pid_file()
        self.set_spectator_mode(False)
        if check_status: self.check_status()
        from .launcher import PyLauncher
        return PyLauncher(self, **kwargs).single_shot()
45041
def _onLeftButtonUp(self, evt):
        """"""
        x = evt.GetX()
        y = self.figure.bbox.height - evt.GetY()
        #print 'release button', 1
        evt.Skip()
        if self.HasCapture(): self.ReleaseMouse()
        FigureCanvasBase.button_release_event(self, x, y, 1, guiEvent=evt)
736622
def __buttonEvent(event):
    
    global  boxRoot, __widgetTexts, __replyButtonText
    __replyButtonText = __widgetTexts[event.widget]
    boxRoot.quit()