def onSaveProfile(self, event): """ """ dlg=wx.FileDialog(self, _("Select profile file to save"), os.path.split(profile.getPreference('last_profile'))[0], style=wx.FD_SAVE) dlg.SetWildcard("ini files (*.ini)|*.ini") if dlg.ShowModal() == wx.ID_OK: profileFile = dlg.GetPath() if not profileFile.endswith('.ini'): if sys.isLinux(): #hack for linux, as for some reason the .ini is not appended. profileFile += '.ini' profile.saveProfile(profileFile) dlg.Destroy()
def onSaveModel(self, event): if self.scanningWorkbench.sceneView._object is None: return dlg = wx.FileDialog(self, _("Save 3D model"), os.path.split(profile.getPreference('last_file'))[0], style=wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT) fileExtensions = meshLoader.saveSupportedExtensions() wildcardList = ';'.join(map(lambda s: '*' + s, fileExtensions)) wildcardFilter = "Mesh files (%s)|%s;%s" % (wildcardList, wildcardList, wildcardList.upper()) dlg.SetWildcard(wildcardFilter) if dlg.ShowModal() == wx.ID_OK: filename = dlg.GetPath() if not filename.endswith('.ply'): if sys.isLinux(): #hack for linux, as for some reason the .ply is not appended. filename += '.ply' meshLoader.saveMesh(filename, self.scanningWorkbench.sceneView._object) self.appendLastFile(filename) dlg.Destroy()
def _getExecutableUrl(version): url = None import platform if sys.isLinux(): url = "https://launchpad.net/~bqopensource/+archive/ubuntu/horus/+files/" url += "horus_" url += version+"-bq1~" url += platform.linux_distribution()[2]+"1_" if platform.architecture()[0] == '64bit': url += "amd64.deb" elif platform.architecture()[0] == '32bit': url += "i386.deb" elif sys.isWindows(): url = "storage.googleapis.com/bq-horus/releases/" url += "Horus_" url += version+".exe" elif sys.isDarwin(): url = "https://storage.googleapis.com/bq-horus/releases/" url += "Horus_" url += version+".dmg" del platform return url