[freecad] 01/04: Disable automatic DXF library download. (Closes: #764814)
Anton Gladky
gladk at moszumanska.debian.org
Fri Oct 24 22:06:31 UTC 2014
This is an automated email from the git hooks/post-receive script.
gladk pushed a commit to branch master
in repository freecad.
commit 9ddbf1588f16be6318fb73ff2ded471665eacfc9
Author: Yorik van Havre <yorik at uncreated.net>
Date: Fri Oct 24 18:58:12 2014 +0200
Disable automatic DXF library download. (Closes: #764814)
---
...01-Disable-automatic-DXF-library-download.patch | 143 +++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 144 insertions(+)
diff --git a/debian/patches/0001-Disable-automatic-DXF-library-download.patch b/debian/patches/0001-Disable-automatic-DXF-library-download.patch
new file mode 100644
index 0000000..be39ce9
--- /dev/null
+++ b/debian/patches/0001-Disable-automatic-DXF-library-download.patch
@@ -0,0 +1,143 @@
+From e2c69f2b445ddf3eab8f9e94e5d41f7ee3d6e590 Mon Sep 17 00:00:00 2001
+From: Yorik van Havre <yorik at uncreated.net>
+Date: Fri, 24 Oct 2014 18:54:58 +0200
+Subject: [PATCH] Disable automatic DXF library download
+
+---
+ src/Mod/Draft/Draft_rc.py | 6 ++--
+ src/Mod/Draft/Resources/ui/userprefs-import1.ui | 33 +++++++++++++++++--
+ src/Mod/Draft/importDXF.py | 43 +++++++++++++++++--------
+ 3 files changed, 64 insertions(+), 18 deletions(-)
+
+diff --git a/src/Mod/Draft/Draft_rc.py b/src/Mod/Draft/Draft_rc.py
+index 645252f..c70c8a4 100644
+--- a/src/Mod/Draft/Draft_rc.py
++++ b/src/Mod/Draft/Draft_rc.py
+@@ -2,16 +2,16 @@
+
+ # Resource object code
+ #
+-# Created: Tue Jun 10 10:08:25 2014
++# Created: Fri Oct 24 18:53:25 2014
+ # by: The Resource Compiler for PySide (Qt v4.8.6)
+ #
+ # WARNING! All changes made in this file will be lost!
+
+ from PySide import QtCore
+
+-qt_resource_data = "\x00\x00\x0a\xed<?xml version=\x221.0\x22 encoding=\x22UTF-8\x22 standalone=\x22no\x22?>\x0a<svg\x0a xmlns:dc=\x22http://purl.org/dc/elements/1.1/\x22\x0a xmlns:cc=\x22http://creativecommons.org/ns#\x22\x0a xmlns:rdf=\x22http://www.w3.org/1999/02/22-rdf-syntax-ns#\x22\x0a xmlns:svg=\x22http://www.w3.org/2000/svg\x22\x0a xmlns=\x22http://www.w3.org/2000/svg\x22\x0a xmlns:sodipodi=\x22http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\x22\x0a xmlns:inksca [...]
++qt_resource_data = "\x00\x00\x0a\xed<?xml version=\x221.0\x22 encoding=\x22UTF-8\x22 standalone=\x22no\x22?>\x0a<svg\x0a xmlns:dc=\x22http://purl.org/dc/elements/1.1/\x22\x0a xmlns:cc=\x22http://creativecommons.org/ns#\x22\x0a xmlns:rdf=\x22http://www.w3.org/1999/02/22-rdf-syntax-ns#\x22\x0a xmlns:svg=\x22http://www.w3.org/2000/svg\x22\x0a xmlns=\x22http://www.w3.org/2000/svg\x22\x0a xmlns:sodipodi=\x22http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd\x22\x0a xmlns:inksca [...]
+ qt_resource_name = "\x00\x05\x00o\xa6S\x00i\x00c\x00o\x00n\x00s\x00\x02\x00\x00\x07\xb9\x00u\x00i\x00\x0c\x0d\xfc\x11\x13\x00t\x00r\x00a\x00n\x00s\x00l\x00a\x00t\x00i\x00o\x00n\x00s\x00\x08\x08\xba\xc7\x93\x00p\x00a\x00t\x00t\x00e\x00r\x00n\x00s\x00\x08\x00HT\xa7\x00l\x00i\x00n\x00e\x00.\x00s\x00v\x00g\x00\x09\x06\xa6\x8f\xe7\x00c\x00r\x00o\x00s\x00s\x00.\x00s\x00v\x00g\x00\x0a\x08\x8b\x0b\xa7\x00s\x00q\x00u\x00a\x00r\x00e\x00.\x00s\x00v\x00g\x00\x0a\x07+\x1aG\x00s\x00i\x00m\x00p\x00l\x [...]
+-qt_resource_struct = "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x10\x00\x02\x00\x00\x00\x05\x00\x00\x00c\x00\x00\x00\x00\x00\x02\x00\x00\x00B\x00\x00\x00!\x00\x00\x008\x00\x02\x00\x00\x00\x05\x00\x00\x00\x1c\x00\x00\x00\x1a\x00\x02\x00\x00\x00\x17\x00\x00\x00\x05\x00\x00\x01\xb4\x00\x00\x00\x00\x00\x01\x00\x083^\x00\x00\x03\x00\x00\x00\x00\x00\x00\x01\x00\x12\xeb\x06\x00\x00\x02\xde\x00\x00\x00\x00\x00\x01\x00\x11\xde\x99\x00\x00\x02h\x00\x00\x00\x00\x00\x01\x [...]
++qt_resource_struct = "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x01\x00\x00\x00\x10\x00\x02\x00\x00\x00\x05\x00\x00\x00c\x00\x00\x00\x00\x00\x02\x00\x00\x00B\x00\x00\x00!\x00\x00\x008\x00\x02\x00\x00\x00\x05\x00\x00\x00\x1c\x00\x00\x00\x1a\x00\x02\x00\x00\x00\x17\x00\x00\x00\x05\x00\x00\x01\xb4\x00\x00\x00\x00\x00\x01\x00\x083^\x00\x00\x03\x00\x00\x00\x00\x00\x00\x01\x00\x12\xeb\x06\x00\x00\x02\xde\x00\x00\x00\x00\x00\x01\x00\x11\xde\x99\x00\x00\x02h\x00\x00\x00\x00\x00\x01\x [...]
+ def qInitResources():
+ QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+diff --git a/src/Mod/Draft/Resources/ui/userprefs-import1.ui b/src/Mod/Draft/Resources/ui/userprefs-import1.ui
+index 11442f6..5af3ae9 100644
+--- a/src/Mod/Draft/Resources/ui/userprefs-import1.ui
++++ b/src/Mod/Draft/Resources/ui/userprefs-import1.ui
+@@ -6,8 +6,8 @@
+ <rect>
+ <x>0</x>
+ <y>0</y>
+- <width>496</width>
+- <height>524</height>
++ <width>505</width>
++ <height>543</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+@@ -21,6 +21,35 @@
+ <number>9</number>
+ </property>
+ <item>
++ <widget class="QGroupBox" name="groupBox_2">
++ <property name="title">
++ <string>Automatic update</string>
++ </property>
++ <layout class="QVBoxLayout" name="verticalLayout_2">
++ <item>
++ <layout class="QHBoxLayout" name="horizontalLayout_9">
++ <item>
++ <widget class="Gui::PrefCheckBox" name="checkBox_3">
++ <property name="toolTip">
++ <string><html><head/><body><p>By checking this, you will allow FreeCAD to download and update the</p><p>components needed for DXF import and export. You can also do that</p><p>manually, by visiting https://github.com/yorikvanhavre/Draft-dxf-importer</p></body></html></string>
++ </property>
++ <property name="text">
++ <string>Allow FreeCAD to automatically download and update the DXF libraries</string>
++ </property>
++ <property name="prefEntry" stdset="0">
++ <cstring>dxfAllowDownload</cstring>
++ </property>
++ <property name="prefPath" stdset="0">
++ <cstring>Mod/Draft</cstring>
++ </property>
++ </widget>
++ </item>
++ </layout>
++ </item>
++ </layout>
++ </widget>
++ </item>
++ <item>
+ <widget class="QGroupBox" name="GroupBox12">
+ <property name="title">
+ <string>DXF format options</string>
+diff --git a/src/Mod/Draft/importDXF.py b/src/Mod/Draft/importDXF.py
+index 320d467..cddfc49 100644
+--- a/src/Mod/Draft/importDXF.py
++++ b/src/Mod/Draft/importDXF.py
+@@ -69,19 +69,36 @@ else:
+ FreeCAD.Console.PrintWarning("DXF libraries need to be updated. Downloading...\n")
+ libsok = False
+ if not libsok:
+- files = ['dxfColorMap.py','dxfImportObjects.py','dxfLibrary.py','dxfReader.py']
+- baseurl = 'https://raw.github.com/yorikvanhavre/Draft-dxf-importer/master/'
+- import ArchCommands
+- for f in files:
+- p = None
+- p = ArchCommands.download(baseurl+f,force=True)
+- if not p:
+- FreeCAD.Console.PrintWarning("Download of dxf libraries failed. Please download them manually from\nhttps://github.com/yorikvanhavre/Draft-dxf-importer\nand place them in your macros folder\n")
+-
+- sys.path.append(FreeCAD.ConfigGet("UserAppData"))
+- try:
+- import dxfColorMap, dxfLibrary, dxfReader
+- except:
++ p = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Draft")
++ dxfAllowDownload = p.GetBool("dxfAllowDownload",False)
++ if dxfAllowDownload:
++ files = ['dxfColorMap.py','dxfImportObjects.py','dxfLibrary.py','dxfReader.py']
++ baseurl = 'https://raw.githubusercontent.com/yorikvanhavre/Draft-dxf-importer/'+str(CURRENTDXFLIB)+"/"
++ import ArchCommands
++ from FreeCAD import Base
++ progressbar = Base.ProgressIndicator()
++ progressbar.start("Downloading files...",4)
++ for f in files:
++ progressbar.next()
++ p = None
++ p = ArchCommands.download(baseurl+f,force=True)
++ if not p:
++ FreeCAD.Console.PrintWarning("Download of dxf libraries failed. Please download them manually from\nhttps://github.com/yorikvanhavre/Draft-dxf-importer\nand place them in your macros folder\n")
++ break
++ progressbar.stop()
++
++ sys.path.append(FreeCAD.ConfigGet("UserAppData"))
++ try:
++ import dxfColorMap, dxfLibrary, dxfReader
++ except ImportError:
++ dxfReader = None
++ dxfLibrary = None
++ else:
++ FreeCAD.Console.PrintWarning("The DXF import/export libraries needed by FreeCAD to handle the DXF format\n")
++ FreeCAD.Console.PrintWarning("were not found on this system. Please either enable FreeCAD to download these\n")
++ FreeCAD.Console.PrintWarning("libraries (menu Edit > Preferences > Import-Export > DXF > Enable downloads) or download\n")
++ FreeCAD.Console.PrintWarning("these libraries manually, as explained on\n")
++ FreeCAD.Console.PrintWarning("https://github.com/yorikvanhavre/Draft-dxf-importer\n")
+ dxfReader = None
+ dxfLibrary = None
+
+--
+2.1.1
+
diff --git a/debian/patches/series b/debian/patches/series
index 7ca8835..e067e40 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ exclude_ply.patch
disable_memory_check.patch
unittest_to_stdout.patch
fix_clang_compilation.patch
+0001-Disable-automatic-DXF-library-download.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/freecad.git
More information about the debian-science-commits
mailing list