Dialog for getting name, location of data export file.
353519
def save_as(self):
        """"""
        filename = splitext(
                self.parent.notes.annot.xml_file)[0] + '_data'
        filename, _ = QFileDialog.getSaveFileName(self, 'Export analysis data',
                                                  filename,
                                                  'CSV (*.csv)')
        if filename == '':
            return

        self.filename = filename
        short_filename = short_strings(basename(self.filename))
        self.idx_filename.setText(short_filename)
134569
def filesfile_string(self):
        """"""
        lines = []
        app = lines.append

        #optic.in     ! Name of input file
        #optic.out    ! Unused
        #optic        ! Root name for all files that will be produced
        app(self.input_file.path)                           # Path to the input file
        app(os.path.join(self.workdir, "unused"))           # Path to the output file
        app(os.path.join(self.workdir, self.prefix.odata))  # Prefix for output data

        return "\n".join(lines)
915914
def get_filename(self, index):
        """"""
        if index:
            return osp.normpath(to_text_string(self.fsmodel.filePath(index)))
1254784
def exportAs(self, action):
        
        plugin = self.exporter(unwrapVariant(action.data()))
        if not plugin:
            return False
        
        ftypes = '{0} (*{1});;All Files (*.*)'.format(plugin.name(),
                                                      plugin.filetype())
        filename = QtGui.QFileDialog.getSaveFileName(self.window(),
                                                     'Export Data',
                                                     '',
                                                     ftypes)
        
        if type(filename) == tuple:
            filename = filename[0]
        
        if filename:
            return self.export(nativestring(filename), exporter=plugin)
        return False
19498
def get_filename(self, index):
        """"""
        if index:
            path = self.fsmodel.filePath(self.proxymodel.mapToSource(index))
            return osp.normpath(to_text_string(path))
788786
def get_display_name(self, short=False):
        
        if self.location is None:
            return '[New file]'
        elif short:
            return os.path.basename(self.location)
        else:
            return self.location
2968
def getLoggingLocation(self):
		""""""
		if sys.platform == "win32":
			modulePath = os.path.realpath(__file__)
			modulePath = modulePath[:modulePath.rfind("/")]
			return modulePath
		else:
			return "/tmp"
		return ""
1334937
function saveNameToExportMap(index, def, exportsMap) {
    if (exportsMap) {
        if (def.exportAs)
            exportsMap[def.exportAs] = index;
        if (def.template)
            exportsMap[''] = index;
    }
}
1200789
def getsavefilename(parent=None, caption='', basedir='', filters='',
                    selectedfilter='', options=None):
    """"""
    return _qfiledialog_wrapper('getSaveFileName', parent=parent,
                                caption=caption, basedir=basedir,
                                filters=filters, selectedfilter=selectedfilter,
                                options=options)
608717
def view_export(self, id, **kwargs):
        ""
        api_path = "/api/v2/views/{id}/export.json"
        api_path = api_path.format(id=id)
        return self.call(api_path, **kwargs)
2054
def export_data(self):
        

        def export_field(value):
            """
            Export item
            """
            try:
                return value.export_data()
            except AttributeError:
                return value

        if self.__modified_data__ is not None:
            return [export_field(value) for value in self.__modified_data__]
        return [export_field(value) for value in self.__original_data__]
802600
def get_export_data(self, file_format, queryset, *args, **kwargs):
        
        request = kwargs.pop("request")
        if not self.has_export_permission(request):
            raise PermissionDenied

        resource_class = self.get_export_resource_class()
        data = resource_class(**self.get_export_resource_kwargs(request)).export(queryset, *args, **kwargs)
        export_data = file_format.export_data(data)
        return export_data
145013
def get_export_allowable_types(cursor, exports_dirs, id, version):
    """"""
    request = get_current_request()
    type_settings = request.registry.settings['_type_info']
    type_names = [k for k, v in type_settings]
    type_infos = [v for k, v in type_settings]
    # We took the type_names directly from the setting this function uses to
    # check for valid types, so it should never raise an ExportError here
    file_tuples = get_export_files(cursor, id, version, type_names,
                                   exports_dirs, read_file=False)
    type_settings = dict(type_settings)
    for filename, mimetype, file_size, file_created, state, file_content \
            in file_tuples:
        type_name = filename.rsplit('.', 1)[-1]
        type_info = type_settings[type_name]
        yield {
            'format': type_info['user_friendly_name'],
            'filename': filename,
            'size': file_size,
            'created': file_created and file_created.isoformat() or None,
            'state': state,
            'details': type_info['description'],
            'path': request.route_path(
                'export', ident_hash=join_ident_hash(id, version),
                type=type_name, ignore=u'/{}'.format(filename))
            }
611352
def filename(self):
        """"""
        if self.value and 'value' in self._json_data and self._json_data['value']:
            return self._json_data['value'].split('/')[-1]
        return None
245175
def get_selected_filenames(self):
        """"""
        if self.selectionMode() == self.ExtendedSelection:
            if self.selectionModel() is None:
                return []
            return [self.get_filename(idx) for idx in 
                    self.selectionModel().selectedRows()]
        else:
            return [self.get_filename(self.currentIndex())]
1270524
def fileBrowser(self):
        """"""
        if capable.OF_TKFD_IN_EPAR:
           fname = askopenfilename(parent=self.entry, title="Select File")
        else:
            from . import filedlg
            self.fd = filedlg.PersistLoadFileDialog(self.entry,
                              "Select File", "*")
            if self.fd.Show() != 1:
                self.fd.DialogCleanup()
                return
            fname = self.fd.GetFileName()
            self.fd.DialogCleanup()
        if not fname: return # canceled

        self.choice.set(fname)
        # don't select when we go back to widget to reduce risk of
        # accidentally typing over the filename
        self.lastSelection = None
964258
def _get_filename(self):
        """"""
        if self._fname is None:
            timestamp = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
            fname = "%s-%s.log" % (timestamp, abs(id(self)))
            self._fname = os.path.join(self.file_path, fname)
        return self._fname