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 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_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 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): 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): 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=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(
import WebGui from StartPage import StartPage WebGui.openBrowserHTML( StartPage.handle(), 'file://' + App.getResourceDir() + 'Mod/Start/StartPage/', 'Start page') App.setActiveDocument("Unnamed") App.ActiveDocument = App.getDocument("Unnamed") Gui.ActiveDocument = Gui.getDocument("Unnamed") from FreeCAD import Vector from pyooml import * a1 = -60 a2 = 70 L1 = 40 L2 = 40 v1 = Vector(L1, 0, 0) v2 = Vector(L2, 0, 0) f0 = frame() f1 = frame() f2 = frame() sv1 = svector(v1).color("yellow") sv2 = svector(v2).color("yellow") import HMatrix Ma = HMatrix.Roty(a1) Mb = HMatrix.Translation(v1) Mc = HMatrix.Roty(a2) Md = HMatrix.Translation(v2) sv1.T = Ma f1.T = Ma * Mb sv2.T = Ma * Mb * Mc f2.T = Ma * Mb * Mc * Md vr = f2.T.multiply(Vector(0, 0, 0))
def testHtmlCase(self): bytestr = b'<b>Fran\xc3\xa7ais</b>' browser = WebGui.openBrowserWindow('Browser') browser.setHtml(bytestr.decode("utf8"), FreeCAD.getResourceDir())
def testHtmlCase(self): bytestr=b'<b>Fran\xc3\xa7ais</b>' browser=WebGui.openBrowserWindow('Browser') browser.setHtml(bytestr.decode("utf8"), FreeCAD.getResourceDir())