def run_reitwander(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "http://www.wanderreitkarte.de/index.php?lon="+str(mx)+"&lat="+str(my)+"&zoom=12")
def run_browser(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "http://www.openstreetmap.org/#map=12/"+str(my)+'/'+str(mx))
def run_browser(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "http://www.openstreetmap.org/#map=12/"+str(my)+'/'+str(mx))
def run_google(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "https://www.google.de/maps/@"+str(my)+','+str(mx) +",8000m/data=!3m1!1e3")
def run_reitwander(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "http://www.wanderreitkarte.de/index.php?lon="+str(mx)+"&lat="+str(my)+"&zoom=12")
def run_google(self): import WebGui bl=self.root.ids['bl'].text() spli=bl.split(',') my=float(spli[0]) mx=float(spli[1]) WebGui.openBrowser( "https://www.google.de/maps/@"+str(my)+','+str(mx) +",8000m/data=!3m1!1e3")
def showMap(self): b=self.root.ids['b'].text() l=self.root.ids['l'].text() s=self.root.ids['s'].value() say([l,b,s]) import WebGui WebGui.openBrowser( "http://www.openstreetmap.org/#map=9/"+str(b)+'/'+str(l))
def showMap(self): bl = self.root.ids["bl"].text() spli = bl.split(",") b = float(spli[0]) l = float(spli[1]) s = 15 WebGui.openBrowser("http://www.openstreetmap.org/#map=16/" + str(b) + "/" + str(l))
def showMap(self): bl=self.root.ids['bl'].text() spli=bl.split(',') b=float(spli[0]) l=float(spli[1]) s=15 WebGui.openBrowser( "http://www.openstreetmap.org/#map=16/"+str(b)+'/'+str(l))
def showMap(self): print "Run values" b=self.root.ids['b'].text() l=self.root.ids['l'].text() s=self.root.ids['s'].value() print [l,b,s] import WebGui WebGui.openBrowser( "http://www.openstreetmap.org/#map=16/"+str(b)+'/'+str(l))
def showMap(self): print "Run values" b = self.root.ids['b'].text() l = self.root.ids['l'].text() s = self.root.ids['s'].value() print[l, b, s] import WebGui WebGui.openBrowser("http://www.openstreetmap.org/#map=16/" + str(b) + '/' + str(l))
def openUrl(self, url): p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/BIM") s = p.GetBool("LibraryWebSearch", False) if s: import WebGui WebGui.openBrowser(url) else: QtGui.QDesktopServices.openUrl(url)
def showMap(self): print "Run values" bl=self.root.ids['bl'].text() spli=bl.split(',') b=float(spli[0]) l=float(spli[1]) s=self.root.ids['s'].value() print [l,b,s] WebGui.openBrowser( "http://www.openstreetmap.org/#map=16/"+str(b)+'/'+str(l))
def on_pushButton02_clicked(self): text = "" for sel in self.listWidget.selectedItems(): plugin = sel.text() text += "*** " + sel.text() + " ***" say(text) say(self.config[sel.text()]) say("ok") text += "\n" + str(self.config[sel.text()]['author']) say(text) text += "\n" + str(self.config[sel.text()]['source']) say(text) text += "\n" + str(self.config[sel.text()]['description']) say(text) text += "\n" mess = "" try: import re source = str(self.config[sel.text()]['source']) say(source) m = re.match(r"https://github.com/(.*)/archive/master.zip", source) say(m) say(m.group(1)) gitdate = 'no date from git' if m: fn = 'https://api.github.com/repos/' + m.group( 1) + '/commits' import urllib, json data = urllib.urlopen(fn).read() d = json.loads(data) dit = d[0] gitdate = dit['commit']['committer']['date'] say(gitdate) installdate = FreeCAD.ParamGet('User parameter:/Plugins/' + plugin).GetString("installdate") if installdate > gitdate: mess = "--- package " + plugin + " is up to date ---" else: mess = "!!! update for " + plugin + " recommented !!!" FreeCAD.ParamGet('User parameter:/Plugins/' + plugin).SetString("gitdate", gitdate) except: sayexc() text += "my install: " + FreeCAD.ParamGet( 'User parameter:/Plugins/' + plugin).GetString("installdate") + "\n" text += "git version: " + FreeCAD.ParamGet( 'User parameter:/Plugins/' + plugin).GetString( "gitdate", "not implemented") + "\n" text += "\n" + mess + "\n\n" self.lab2.setText(text) if self.config[sel.text()].has_key('web'): WebGui.openBrowser(str(self.config[sel.text()]['web'])) say("done")
def showMap(self): '''open a webbrowser window and display the openstreetmap presentation of the area''' bl=self.root.ids['bl'].text() spli=bl.split(',') b=float(spli[0]) l=float(spli[1]) s=self.root.ids['s'].value() print [l,b,s] WebGui.openBrowser( "http://www.openstreetmap.org/#map=16/"+str(b)+'/'+str(l))
def showMap(self): print "Run values" bl = self.root.ids['bl'].text() spli = bl.split(',') b = float(spli[0]) l = float(spli[1]) s = self.root.ids['s'].value() print[l, b, s] WebGui.openBrowser("http://www.openstreetmap.org/#map=16/" + str(b) + '/' + str(l))
def showMap(self): """ Open a webbrowser window and display the openstreetmap presentation of the area """ bl_disp = self.root.ids['lat'].text() b = float(bl_disp) bl_disp = self.root.ids['long'].text() l = float(bl_disp) WebGui.openBrowser("http://www.openstreetmap.org/#map=16/" + str(b) + '/' + str(l))
def showMap(self): '''open a webbrowser window and display the openstreetmap presentation of the area''' bl_disp=self.root.ids['lat'].text() b=float(bl_disp) bl_disp=self.root.ids['long'].text() l=float(bl_disp) s=self.root.ids['s'].value() print [l,b,s] WebGui.openBrowser( "http://www.openstreetmap.org/#map=16/"+str(b)+'/'+str(l))
def showMap(self): """ open a webbrowser window and display the openstreetmap presentation of the area """ bl_disp = self.root.ids["lat"].text() lat = float(bl_disp) bl_disp = self.root.ids["long"].text() lon = float(bl_disp) # s = self.root.ids["s"].value() WebGui.openBrowser("http://www.openstreetmap.org/#map=16/{}/{}".format( lat, lon))
def on_pushButton02_clicked(self): text="" for sel in self.listWidget.selectedItems(): plugin=sel.text() text += "*** "+ sel.text() + " ***" say(text) say(self.config[sel.text()]) say("ok") text += "\n" + str(self.config[sel.text()]['author']) say(text) text += "\n" + str(self.config[sel.text()]['source']) say(text) text += "\n" + str(self.config[sel.text()]['description']) say(text) text += "\n" mess="" try: import re source=str(self.config[sel.text()]['source']) say(source) m = re.match(r"https://github.com/(.*)/archive/master.zip", source) say(m) say(m.group(1)) gitdate='no date from git' if m: fn='https://api.github.com/repos/' + m.group(1) + '/commits' import urllib,json data=urllib.urlopen(fn).read() d = json.loads(data) dit=d[0] gitdate=dit['commit']['committer']['date'] say(gitdate) installdate=FreeCAD.ParamGet('User parameter:/Plugins/'+plugin).GetString("installdate") if installdate >gitdate: mess="--- package " + plugin + " is up to date ---" else: mess="!!! update for " + plugin + " recommented !!!" FreeCAD.ParamGet('User parameter:/Plugins/'+plugin).SetString("gitdate",gitdate) except: sayexc() text += "my install: " + FreeCAD.ParamGet('User parameter:/Plugins/'+plugin).GetString("installdate") + "\n" text += "git version: " + FreeCAD.ParamGet('User parameter:/Plugins/'+plugin).GetString("gitdate","not implemented") + "\n" text += "\n" + mess + "\n\n" self.lab2.setText(text) if self.config[sel.text()].has_key('web'): WebGui.openBrowser( str(self.config[sel.text()]['web'])) say("done")
def Activated(self): import WebGui fn = 'https://htmlpreview.github.io/?https://raw.githubusercontent.com/microelly2/freecad-transportation-wb-docu/master/html/index.html' WebGui.openBrowser(fn)
# "Selection view" # "Combo View" # "Python console" # "draftToolbar" for i in dws: if i.objectName() == "Report view": dw = i break va = dw.toggleViewAction() va.setChecked(True) # True or False dw.setVisible(True) # True or False import WebGui WebGui.openBrowser("http://www.example.com") from PySide import QtGui, QtWebKit a = QtGui.qApp mw = a.activeWindow() v = mw.findChild(QtWebKit.QWebFrame) html = unicode(v.toHtml()) print(html) # -*- coding: utf-8 -*- # the line above to put the accentuated in the remarks # If this line is missing, an error will be returned # extract and use the coordinates of 3 objects selected import Part, FreeCAD, math, PartGui, FreeCADGui from FreeCAD import Base, Console sel = FreeCADGui.Selection.getSelection(