source/riffle/browser.py
def setLocation(self, path, interactive=False):
        '''Set current location to *path*.

        *path* must be the same as root or under the root.

        .. note::

            Comparisons are case-sensitive. If you set the root as 'D:/' then
            location can be set as 'D:/folder' *not* 'd:/folder'.

        If *interactive* is True, catch any exception occurring and display an
        appropriate warning dialog to the user. Otherwise allow exceptions to
        bubble up as normal.

        '''
        try:
            self._setLocation(path)
        except Exception as error:
            if not interactive:
                raise
            else:
                warning_dialog = QtGui.QMessageBox(
                    QtGui.QMessageBox.Warning,
                    'Location is not available',
                    '{0} is not accessible.'.format(path),
                    QtGui.QMessageBox.Ok,
                    self
                )
                warning_dialog.setDetailedText(str(error))
                warning_dialog.exec_()
def setLocation(self, path, interactive=False):
        '''Set current location to *path*.

        *path* must be the same as root or under the root.

        .. note::

            Comparisons are case-sensitive. If you set the root as 'D:/' then
            location can be set as 'D:/folder' *not* 'd:/folder'.

        If *interactive* is True, catch any exception occurring and display an
        appropriate warning dialog to the user. Otherwise allow exceptions to
        bubble up as normal.

        '''
        try:
            self._setLocation(path)
        except Exception as error:
            if not interactive:
                raise
            else:
                warning_dialog = QtGui.QMessageBox(
                    QtGui.QMessageBox.Warning,
                    'Location is not available',
                    '{0} is not accessible.'.format(path),
                    QtGui.QMessageBox.Ok,
                    self
                )
                warning_dialog.setDetailedText(str(error))
                warning_dialog.exec_()
Set current location to *path*.

        *path* must be the same as root or under the root.

        .. note::

            Comparisons are case-sensitive. If you set the root as 'D:/' then
            location can be set as 'D:/folder' *not* 'd:/folder'.

        If *interactive* is True, catch any exception occurring and display an
        appropriate warning dialog to the user. Otherwise allow exceptions to
        bubble up as normal.