Bugzilla – Attachment 151055 Details for
Bug 125013
Python error 'certificate verify failed (_ssl.c:719)'
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
Example script to demo error
InsertImage.py (text/x-python), 1.97 KB, created by
Leif Lodahl
on 2019-04-28 17:33:36 UTC
(
hide
)
Description:
Example script to demo error
Filename:
MIME Type:
Creator:
Leif Lodahl
Created:
2019-04-28 17:33:36 UTC
Size:
1.97 KB
patch
obsolete
># -*- coding: utf-8 -*- ># !/usr/bin/env python > >import uno >import os >import os.path >from urllib.request import urlopen, urlretrieve >from com.sun.star.beans import PropertyValue > >ImageUrl="http://allsignalprocessing.com/wp-content/uploads/2014/07/Joseph_Fourier.png" > >localpath = os.environ['HOME'] + os.path.sep + "OCAL" + os.path.sep > >def get_filename_parts_from_url(url): > fullname = url.split(os.path.sep)[-1].split('#')[0].split('?')[0] > > return fullname > >def download(): > url="https://allsignalprocessing.com/wp-content/uploads/2014/07/Joseph_Fourier.png" > # If the file does not already exist locally, download it. > # Always return the full local filename. > if not (os.path.exists(localpath)): > os.makedirs(localpath) > relativeFilename = get_filename_parts_from_url(url) > absoluteFilename = localpath + relativeFilename > if not (os.path.exists(absoluteFilename)): > urlretrieve(url, absoluteFilename) > return absoluteFilename > >def insertImage(): > ImageUrl="http://allsignalprocessing.com/wp-content/uploads/2014/07/Joseph_Fourier.png" > localpath = os.environ['HOME'] + os.path.sep + "OCAL" + os.path.sep > absoluteFilename=localpath+get_filename_parts_from_url(ImageUrl) > imageName=absoluteFilename > ctx = XSCRIPTCONTEXT.getComponentContext() > smgr = ctx.getServiceManager() > doc = XSCRIPTCONTEXT.getDocument() > document = XSCRIPTCONTEXT.getDocument().getCurrentController().getFrame() > desktop = XSCRIPTCONTEXT.getDesktop() > > dispatcher = smgr.createInstanceWithContext("com.sun.star.frame.DispatchHelper", ctx) > > args = [ PropertyValue() for i in range(4)] > args[0].Name="FileName" > args[0].Value="file://"+absoluteFilename > args[1].Name="FilterName" > args[1].Value="<All formats>" > args[2].Name = "AsLink" > args[2].Value = False > args[3].Name="Style" > args[3].Value="Graphics" > > dispatcher.executeDispatch(document, ".uno:InsertGraphic", "", 0, tuple(args)) > > > >g_exportedScripts = insertImage, download,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 125013
: 151055 |
155211
|
155212
|
156336
|
156337