Sat, 18 Jul 2015 16:50:24 +0200
Improved parsing of the content disposition header analog to the way it is done in qutebrowser.
--- a/APIs/Python3/eric6.api Sat Jul 18 15:14:28 2015 +0200 +++ b/APIs/Python3/eric6.api Sat Jul 18 16:50:24 2015 +0200 @@ -1669,6 +1669,29 @@ eric6.E5Network.E5NetworkProxyFactory.E5NetworkProxyFactory?1() eric6.E5Network.E5NetworkProxyFactory.proxyAuthenticationRequired?4(proxy, auth) eric6.E5Network.E5NetworkProxyFactory.schemeFromProxyType?4(proxyType) +eric6.E5Network.E5RFC6266.Charset.grammar?7 +eric6.E5Network.E5RFC6266.ContentDisposition.filename?4() +eric6.E5Network.E5RFC6266.ContentDisposition.is_inline?4() +eric6.E5Network.E5RFC6266.ContentDisposition?1(disposition='inline', assocs=None) +eric6.E5Network.E5RFC6266.ContentDisposition?1(filename) +eric6.E5Network.E5RFC6266.ContentDispositionValue.grammar?7 +eric6.E5Network.E5RFC6266.ContentDisposition_1.filename?4() +eric6.E5Network.E5RFC6266.DispositionParm.grammar?7 +eric6.E5Network.E5RFC6266.DispositionParmList.grammar?7 +eric6.E5Network.E5RFC6266.DispositionType.grammar?7 +eric6.E5Network.E5RFC6266.ExtDispositionParm.grammar?7 +eric6.E5Network.E5RFC6266.ExtDispositionParm?1(value, name=None) +eric6.E5Network.E5RFC6266.ExtToken.regex?7 +eric6.E5Network.E5RFC6266.ExtValue.grammar?7 +eric6.E5Network.E5RFC6266.Language.grammar?7 +eric6.E5Network.E5RFC6266.NoExtToken.regex?7 +eric6.E5Network.E5RFC6266.QuotedString.grammar?7 +eric6.E5Network.E5RFC6266.Token.grammar?7 +eric6.E5Network.E5RFC6266.Value.grammar?7 +eric6.E5Network.E5RFC6266.ValueChars.grammar?7 +eric6.E5Network.E5RFC6266.normalize_ws?4(text) +eric6.E5Network.E5RFC6266.parse_ext_value?4(val) +eric6.E5Network.E5RFC6266.parse_headers?4(content_disposition) eric6.E5Network.E5SslCertificatesDialog.E5SslCertificatesDialog.CertRole?7 eric6.E5Network.E5SslCertificatesDialog.E5SslCertificatesDialog.on_caCertificatesTree_currentItemChanged?4(current, previous) eric6.E5Network.E5SslCertificatesDialog.E5SslCertificatesDialog.on_caDeleteButton_clicked?4() @@ -2667,6 +2690,7 @@ eric6.Helpviewer.HelpUtilities.ensureUniqueFilename?4(name, appendFormat="({0})") eric6.Helpviewer.HelpUtilities.filterCharsFromFilename?4(name) eric6.Helpviewer.HelpUtilities.getFileNameFromUrl?4(url) +eric6.Helpviewer.HelpUtilities.parseContentDisposition?4(reply) eric6.Helpviewer.HelpWebSearchWidget.HelpWebSearchWidget.clear?4() eric6.Helpviewer.HelpWebSearchWidget.HelpWebSearchWidget.mousePressEvent?4(evt) eric6.Helpviewer.HelpWebSearchWidget.HelpWebSearchWidget.openSearchManager?4()
--- a/APIs/Python3/eric6.bas Sat Jul 18 15:14:28 2015 +0200 +++ b/APIs/Python3/eric6.bas Sat Jul 18 16:50:24 2015 +0200 @@ -60,6 +60,7 @@ CallStackViewer QTreeWidget CallTraceViewer QWidget Ui_CallTraceViewer ChangeBookmarkCommand QUndoCommand +Charset str ChatWidget QWidget Ui_ChatWidget ChromeImporter BookmarksImporter Class ClbrBaseClasses.Class VisibilityMixin @@ -129,10 +130,14 @@ DiffReport StandardReport DiffWindow E5MainWindow DirectorySyncHandler SyncHandler +DispositionParm str +DispositionParmList UniqueNamespace +DispositionType peg.List DownloadAskActionDialog QDialog Ui_DownloadAskActionDialog DownloadItem QWidget Ui_DownloadItem DownloadManager QDialog Ui_DownloadManager DownloadModel QAbstractListModel +DuplicateParamError Exception E5Action QAction E5Application QApplication E5ArrowItem QAbstractGraphicsShapeItem @@ -237,6 +242,8 @@ ExporterPDF ExporterBase ExporterRTF ExporterBase ExporterTEX ExporterBase +ExtToken peg.Symbol +ExtValue peg.List FavIconLabel QLabel FeaturePermissionBar QWidget FeedEditDialog QDialog Ui_FeedEditDialog @@ -388,6 +395,7 @@ InsertBookmarksCommand RemoveBookmarksCommand Interface ClbrBaseClasses.Class VisibilityMixin InterfacePage ConfigurationPageBase Ui_InterfacePage +InvalidISO8859Error Exception InvalidPlistException Exception IrcChannelEditDialog QDialog Ui_IrcChannelEditDialog IrcChannelWidget QWidget Ui_IrcChannelWidget @@ -403,6 +411,7 @@ IrcWidget QWidget Ui_IrcWidget JavaScriptEricObject QObject JavaScriptExternalObject QObject +Language str Largefiles HgExtension LargefilesProjectBrowserHelper HgExtensionProjectBrowserHelper LargefilesProjectHelper HgExtensionProjectHelper @@ -475,6 +484,7 @@ NewDialogClassDialog QDialog Ui_NewDialogClassDialog NewPythonPackageDialog QDialog Ui_NewPythonPackageDialog NoCacheHostsDialog QDialog Ui_NoCacheHostsDialog +NoExtToken peg.Symbol NotBinaryPlistException Exception NotificationWidget QWidget Ui_NotificationWidget NotificationsPage ConfigurationPageBase Ui_NotificationsPage @@ -590,6 +600,7 @@ Queues HgExtension QueuesProjectHelper HgExtensionProjectHelper QuickSearchLineEdit QLineEdit +QuotedString str RbModule Class Rebase HgExtension RebaseProjectHelper HgExtensionProjectHelper @@ -716,6 +727,7 @@ TemplatesPage ConfigurationPageBase Ui_TemplatesPage TemplatesReader XMLStreamReaderBase TemplatesWriter XMLStreamWriterBase +Token str ToolConfigurationDialog QDialog Ui_ToolConfigurationDialog ToolGroupConfigurationDialog QDialog Ui_ToolGroupConfigurationDialog TranslationPropertiesDialog QDialog Ui_TranslationPropertiesDialog @@ -733,6 +745,7 @@ UMLItem QGraphicsRectItem UMLSceneSizeDialog QDialog Ui_UMLSceneSizeDialog Uid int +UniqueNamespace peg.Namespace UnittestDialog QWidget Ui_UnittestDialog UnittestWindow E5MainWindow UrlBar E5LineEdit @@ -746,6 +759,8 @@ UserProjectReader XMLStreamReaderBase UserProjectWriter XMLStreamWriterBase UserPropertiesDialog QDialog Ui_UserPropertiesDialog +Value str +ValueChars str VariableDetailDialog QDialog Ui_VariableDetailDialog VariableItem QTreeWidgetItem VariablesFilterDialog QDialog Ui_VariablesFilterDialog
--- a/Documentation/Help/source.qhp Sat Jul 18 15:14:28 2015 +0200 +++ b/Documentation/Help/source.qhp Sat Jul 18 16:50:24 2015 +0200 @@ -156,6 +156,7 @@ <section title="eric6.E5Network.E5NetworkHeaderDetailsDialog" ref="eric6.E5Network.E5NetworkHeaderDetailsDialog.html" /> <section title="eric6.E5Network.E5NetworkMonitor" ref="eric6.E5Network.E5NetworkMonitor.html" /> <section title="eric6.E5Network.E5NetworkProxyFactory" ref="eric6.E5Network.E5NetworkProxyFactory.html" /> + <section title="eric6.E5Network.E5RFC6266" ref="eric6.E5Network.E5RFC6266.html" /> <section title="eric6.E5Network.E5SslCertificatesDialog" ref="eric6.E5Network.E5SslCertificatesDialog.html" /> <section title="eric6.E5Network.E5SslCertificatesInfoDialog" ref="eric6.E5Network.E5SslCertificatesInfoDialog.html" /> <section title="eric6.E5Network.E5SslCertificatesInfoWidget" ref="eric6.E5Network.E5SslCertificatesInfoWidget.html" /> @@ -1955,6 +1956,7 @@ <keyword name="ChangeBookmarkCommand (Constructor)" id="ChangeBookmarkCommand (Constructor)" ref="eric6.Helpviewer.Bookmarks.BookmarksManager.html#ChangeBookmarkCommand.__init__" /> <keyword name="ChangeBookmarkCommand.redo" id="ChangeBookmarkCommand.redo" ref="eric6.Helpviewer.Bookmarks.BookmarksManager.html#ChangeBookmarkCommand.redo" /> <keyword name="ChangeBookmarkCommand.undo" id="ChangeBookmarkCommand.undo" ref="eric6.Helpviewer.Bookmarks.BookmarksManager.html#ChangeBookmarkCommand.undo" /> + <keyword name="Charset" id="Charset" ref="eric6.E5Network.E5RFC6266.html#Charset" /> <keyword name="ChatWidget" id="ChatWidget" ref="eric6.Cooperation.ChatWidget.html#ChatWidget" /> <keyword name="ChatWidget (Constructor)" id="ChatWidget (Constructor)" ref="eric6.Cooperation.ChatWidget.html#ChatWidget.__init__" /> <keyword name="ChatWidget (Module)" id="ChatWidget (Module)" ref="eric6.Cooperation.ChatWidget.html" /> @@ -2449,6 +2451,14 @@ <keyword name="Connection.setClient" id="Connection.setClient" ref="eric6.Cooperation.Connection.html#Connection.setClient" /> <keyword name="Connection.setGreetingMessage" id="Connection.setGreetingMessage" ref="eric6.Cooperation.Connection.html#Connection.setGreetingMessage" /> <keyword name="Connection.timerEvent" id="Connection.timerEvent" ref="eric6.Cooperation.Connection.html#Connection.timerEvent" /> + <keyword name="ContentDisposition" id="ContentDisposition" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition" /> + <keyword name="ContentDisposition (Constructor)" id="ContentDisposition (Constructor)" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition.__init__" /> + <keyword name="ContentDisposition.filename" id="ContentDisposition.filename" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition.filename" /> + <keyword name="ContentDisposition.is_inline" id="ContentDisposition.is_inline" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition.is_inline" /> + <keyword name="ContentDispositionValue" id="ContentDispositionValue" ref="eric6.E5Network.E5RFC6266.html#ContentDispositionValue" /> + <keyword name="ContentDisposition_1" id="ContentDisposition_1" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition_1" /> + <keyword name="ContentDisposition_1 (Constructor)" id="ContentDisposition_1 (Constructor)" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition_1.__init__" /> + <keyword name="ContentDisposition_1.filename" id="ContentDisposition_1.filename" ref="eric6.E5Network.E5RFC6266.html#ContentDisposition_1.filename" /> <keyword name="Context" id="Context" ref="eric6.DebugClients.Ruby.Debuggee.html#Context" /> <keyword name="Context.clear_suspend" id="Context.clear_suspend" ref="eric6.DebugClients.Ruby.Debuggee.html#Context.clear_suspend" /> <keyword name="Context.current_binding" id="Context.current_binding" ref="eric6.DebugClients.Ruby.Debuggee.html#Context.current_binding" /> @@ -3373,6 +3383,9 @@ <keyword name="DirectorySyncHandler.syncPasswords" id="DirectorySyncHandler.syncPasswords" ref="eric6.Helpviewer.Sync.DirectorySyncHandler.html#DirectorySyncHandler.syncPasswords" /> <keyword name="DirectorySyncHandler.syncSpeedDial" id="DirectorySyncHandler.syncSpeedDial" ref="eric6.Helpviewer.Sync.DirectorySyncHandler.html#DirectorySyncHandler.syncSpeedDial" /> <keyword name="DirectorySyncHandler.syncUserAgents" id="DirectorySyncHandler.syncUserAgents" ref="eric6.Helpviewer.Sync.DirectorySyncHandler.html#DirectorySyncHandler.syncUserAgents" /> + <keyword name="DispositionParm" id="DispositionParm" ref="eric6.E5Network.E5RFC6266.html#DispositionParm" /> + <keyword name="DispositionParmList" id="DispositionParmList" ref="eric6.E5Network.E5RFC6266.html#DispositionParmList" /> + <keyword name="DispositionType" id="DispositionType" ref="eric6.E5Network.E5RFC6266.html#DispositionType" /> <keyword name="DocStyleChecker" id="DocStyleChecker" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker" /> <keyword name="DocStyleChecker (Constructor)" id="DocStyleChecker (Constructor)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html#DocStyleChecker.__init__" /> <keyword name="DocStyleChecker (Module)" id="DocStyleChecker (Module)" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.DocStyleChecker.html" /> @@ -3514,6 +3527,7 @@ <keyword name="DownloadModel.removeRows" id="DownloadModel.removeRows" ref="eric6.Helpviewer.Download.DownloadModel.html#DownloadModel.removeRows" /> <keyword name="DownloadModel.rowCount" id="DownloadModel.rowCount" ref="eric6.Helpviewer.Download.DownloadModel.html#DownloadModel.rowCount" /> <keyword name="DownloadUtilities (Module)" id="DownloadUtilities (Module)" ref="eric6.Helpviewer.Download.DownloadUtilities.html" /> + <keyword name="DuplicateParamError" id="DuplicateParamError" ref="eric6.E5Network.E5RFC6266.html#DuplicateParamError" /> <keyword name="E5Action" id="E5Action" ref="eric6.E5Gui.E5Action.html#E5Action" /> <keyword name="E5Action (Constructor)" id="E5Action (Constructor)" ref="eric6.E5Gui.E5Action.html#E5Action.__init__" /> <keyword name="E5Action (Module)" id="E5Action (Module)" ref="eric6.E5Gui.E5Action.html" /> @@ -3835,6 +3849,7 @@ <keyword name="E5ProgressDialog (Module)" id="E5ProgressDialog (Module)" ref="eric6.E5Gui.E5ProgressDialog.html" /> <keyword name="E5ProgressDialog.format" id="E5ProgressDialog.format" ref="eric6.E5Gui.E5ProgressDialog.html#E5ProgressDialog.format" /> <keyword name="E5ProgressDialog.setFormat" id="E5ProgressDialog.setFormat" ref="eric6.E5Gui.E5ProgressDialog.html#E5ProgressDialog.setFormat" /> + <keyword name="E5RFC6266 (Module)" id="E5RFC6266 (Module)" ref="eric6.E5Network.E5RFC6266.html" /> <keyword name="E5RequestModel" id="E5RequestModel" ref="eric6.E5Network.E5NetworkMonitor.html#E5RequestModel" /> <keyword name="E5RequestModel (Constructor)" id="E5RequestModel (Constructor)" ref="eric6.E5Network.E5NetworkMonitor.html#E5RequestModel.__init__" /> <keyword name="E5RequestModel.__addReply" id="E5RequestModel.__addReply" ref="eric6.E5Network.E5NetworkMonitor.html#E5RequestModel.__addReply" /> @@ -4854,6 +4869,11 @@ <keyword name="ExporterTEX.__texStyle" id="ExporterTEX.__texStyle" ref="eric6.QScintilla.Exporters.ExporterTEX.html#ExporterTEX.__texStyle" /> <keyword name="ExporterTEX.exportSource" id="ExporterTEX.exportSource" ref="eric6.QScintilla.Exporters.ExporterTEX.html#ExporterTEX.exportSource" /> <keyword name="Exporters (Package)" id="Exporters (Package)" ref="index-eric6.QScintilla.Exporters.html" /> + <keyword name="ExtDispositionParm" id="ExtDispositionParm" ref="eric6.E5Network.E5RFC6266.html#ExtDispositionParm" /> + <keyword name="ExtDispositionParm (Constructor)" id="ExtDispositionParm (Constructor)" ref="eric6.E5Network.E5RFC6266.html#ExtDispositionParm.__init__" /> + <keyword name="ExtToken" id="ExtToken" ref="eric6.E5Network.E5RFC6266.html#ExtToken" /> + <keyword name="ExtToken.__str__" id="ExtToken.__str__" ref="eric6.E5Network.E5RFC6266.html#ExtToken.__str__" /> + <keyword name="ExtValue" id="ExtValue" ref="eric6.E5Network.E5RFC6266.html#ExtValue" /> <keyword name="FavIconLabel" id="FavIconLabel" ref="eric6.Helpviewer.UrlBar.FavIconLabel.html#FavIconLabel" /> <keyword name="FavIconLabel (Constructor)" id="FavIconLabel (Constructor)" ref="eric6.Helpviewer.UrlBar.FavIconLabel.html#FavIconLabel.__init__" /> <keyword name="FavIconLabel (Module)" id="FavIconLabel (Module)" ref="eric6.Helpviewer.UrlBar.FavIconLabel.html" /> @@ -7046,6 +7066,7 @@ <keyword name="InterfacePage.on_resetLayoutButton_clicked" id="InterfacePage.on_resetLayoutButton_clicked" ref="eric6.Preferences.ConfigurationPages.InterfacePage.html#InterfacePage.on_resetLayoutButton_clicked" /> <keyword name="InterfacePage.on_styleSheetButton_clicked" id="InterfacePage.on_styleSheetButton_clicked" ref="eric6.Preferences.ConfigurationPages.InterfacePage.html#InterfacePage.on_styleSheetButton_clicked" /> <keyword name="InterfacePage.save" id="InterfacePage.save" ref="eric6.Preferences.ConfigurationPages.InterfacePage.html#InterfacePage.save" /> + <keyword name="InvalidISO8859Error" id="InvalidISO8859Error" ref="eric6.E5Network.E5RFC6266.html#InvalidISO8859Error" /> <keyword name="InvalidPlistException" id="InvalidPlistException" ref="eric6.Utilities.binplistlib.html#InvalidPlistException" /> <keyword name="IrcChannel" id="IrcChannel" ref="eric6.Network.IRC.IrcNetworkManager.html#IrcChannel" /> <keyword name="IrcChannel (Constructor)" id="IrcChannel (Constructor)" ref="eric6.Network.IRC.IrcNetworkManager.html#IrcChannel.__init__" /> @@ -7377,6 +7398,7 @@ <keyword name="JavaScriptExternalObject (Constructor)" id="JavaScriptExternalObject (Constructor)" ref="eric6.Helpviewer.HelpBrowserWV.html#JavaScriptExternalObject.__init__" /> <keyword name="JavaScriptExternalObject.AddSearchProvider" id="JavaScriptExternalObject.AddSearchProvider" ref="eric6.Helpviewer.HelpBrowserWV.html#JavaScriptExternalObject.AddSearchProvider" /> <keyword name="JavaScriptResources (Module)" id="JavaScriptResources (Module)" ref="eric6.Helpviewer.JavaScriptResources.html" /> + <keyword name="Language" id="Language" ref="eric6.E5Network.E5RFC6266.html#Language" /> <keyword name="Largefiles" id="Largefiles" ref="eric6.Plugins.VcsPlugins.vcsMercurial.LargefilesExtension.largefiles.html#Largefiles" /> <keyword name="Largefiles (Constructor)" id="Largefiles (Constructor)" ref="eric6.Plugins.VcsPlugins.vcsMercurial.LargefilesExtension.largefiles.html#Largefiles.__init__" /> <keyword name="Largefiles.hgAdd" id="Largefiles.hgAdd" ref="eric6.Plugins.VcsPlugins.vcsMercurial.LargefilesExtension.largefiles.html#Largefiles.hgAdd" /> @@ -8167,6 +8189,8 @@ <keyword name="NoCacheHostsDialog (Module)" id="NoCacheHostsDialog (Module)" ref="eric6.Helpviewer.Network.NoCacheHostsDialog.html" /> <keyword name="NoCacheHostsDialog.accept" id="NoCacheHostsDialog.accept" ref="eric6.Helpviewer.Network.NoCacheHostsDialog.html#NoCacheHostsDialog.accept" /> <keyword name="NoCacheHostsDialog.on_addButton_clicked" id="NoCacheHostsDialog.on_addButton_clicked" ref="eric6.Helpviewer.Network.NoCacheHostsDialog.html#NoCacheHostsDialog.on_addButton_clicked" /> + <keyword name="NoExtToken" id="NoExtToken" ref="eric6.E5Network.E5RFC6266.html#NoExtToken" /> + <keyword name="NoExtToken.__str__" id="NoExtToken.__str__" ref="eric6.E5Network.E5RFC6266.html#NoExtToken.__str__" /> <keyword name="NoneSplashScreen" id="NoneSplashScreen" ref="eric6.UI.SplashScreen.html#NoneSplashScreen" /> <keyword name="NoneSplashScreen (Constructor)" id="NoneSplashScreen (Constructor)" ref="eric6.UI.SplashScreen.html#NoneSplashScreen.__init__" /> <keyword name="NoneSplashScreen.clearMessage" id="NoneSplashScreen.clearMessage" ref="eric6.UI.SplashScreen.html#NoneSplashScreen.clearMessage" /> @@ -9881,6 +9905,8 @@ <keyword name="QuickSearchLineEdit.editorCommand" id="QuickSearchLineEdit.editorCommand" ref="eric6.ViewManager.ViewManager.html#QuickSearchLineEdit.editorCommand" /> <keyword name="QuickSearchLineEdit.focusInEvent" id="QuickSearchLineEdit.focusInEvent" ref="eric6.ViewManager.ViewManager.html#QuickSearchLineEdit.focusInEvent" /> <keyword name="QuickSearchLineEdit.keyPressEvent" id="QuickSearchLineEdit.keyPressEvent" ref="eric6.ViewManager.ViewManager.html#QuickSearchLineEdit.keyPressEvent" /> + <keyword name="QuotedString" id="QuotedString" ref="eric6.E5Network.E5RFC6266.html#QuotedString" /> + <keyword name="QuotedString.__str__" id="QuotedString.__str__" ref="eric6.E5Network.E5RFC6266.html#QuotedString.__str__" /> <keyword name="RbModule" id="RbModule" ref="eric6.Utilities.ModuleParser.html#RbModule" /> <keyword name="RbModule (Constructor)" id="RbModule (Constructor)" ref="eric6.Utilities.ModuleParser.html#RbModule.__init__" /> <keyword name="RbModule.addClass" id="RbModule.addClass" ref="eric6.Utilities.ModuleParser.html#RbModule.addClass" /> @@ -11842,6 +11868,7 @@ <keyword name="TemplatesWriter (Module)" id="TemplatesWriter (Module)" ref="eric6.E5XML.TemplatesWriter.html" /> <keyword name="TemplatesWriter.writeXML" id="TemplatesWriter.writeXML" ref="eric6.E5XML.TemplatesWriter.html#TemplatesWriter.writeXML" /> <keyword name="Token" id="Token" ref="eric6.DataViews.CodeMetrics.html#Token" /> + <keyword name="Token" id="Token" ref="eric6.E5Network.E5RFC6266.html#Token" /> <keyword name="Token (Constructor)" id="Token (Constructor)" ref="eric6.DataViews.CodeMetrics.html#Token.__init__" /> <keyword name="ToolConfigurationDialog" id="ToolConfigurationDialog" ref="eric6.Preferences.ToolConfigurationDialog.html#ToolConfigurationDialog" /> <keyword name="ToolConfigurationDialog (Constructor)" id="ToolConfigurationDialog (Constructor)" ref="eric6.Preferences.ToolConfigurationDialog.html#ToolConfigurationDialog.__init__" /> @@ -12085,6 +12112,8 @@ <keyword name="UMLSceneSizeDialog.getData" id="UMLSceneSizeDialog.getData" ref="eric6.Graphics.UMLSceneSizeDialog.html#UMLSceneSizeDialog.getData" /> <keyword name="Uid" id="Uid" ref="eric6.Utilities.binplistlib.html#Uid" /> <keyword name="Uid.__repr__" id="Uid.__repr__" ref="eric6.Utilities.binplistlib.html#Uid.__repr__" /> + <keyword name="UniqueNamespace" id="UniqueNamespace" ref="eric6.E5Network.E5RFC6266.html#UniqueNamespace" /> + <keyword name="UniqueNamespace.__setitem__" id="UniqueNamespace.__setitem__" ref="eric6.E5Network.E5RFC6266.html#UniqueNamespace.__setitem__" /> <keyword name="UnittestDialog" id="UnittestDialog" ref="eric6.PyUnit.UnittestDialog.html#UnittestDialog" /> <keyword name="UnittestDialog (Constructor)" id="UnittestDialog (Constructor)" ref="eric6.PyUnit.UnittestDialog.html#UnittestDialog.__init__" /> <keyword name="UnittestDialog (Module)" id="UnittestDialog (Module)" ref="eric6.PyUnit.UnittestDialog.html" /> @@ -12401,6 +12430,8 @@ <keyword name="UserPropertiesDialog.storeData" id="UserPropertiesDialog.storeData" ref="eric6.Project.UserPropertiesDialog.html#UserPropertiesDialog.storeData" /> <keyword name="Utilities (Package)" id="Utilities (Package)" ref="index-eric6.Utilities.html" /> <keyword name="VCS (Package)" id="VCS (Package)" ref="index-eric6.VCS.html" /> + <keyword name="Value" id="Value" ref="eric6.E5Network.E5RFC6266.html#Value" /> + <keyword name="ValueChars" id="ValueChars" ref="eric6.E5Network.E5RFC6266.html#ValueChars" /> <keyword name="VariableDetailDialog" id="VariableDetailDialog" ref="eric6.Debugger.VariableDetailDialog.html#VariableDetailDialog" /> <keyword name="VariableDetailDialog (Constructor)" id="VariableDetailDialog (Constructor)" ref="eric6.Debugger.VariableDetailDialog.html#VariableDetailDialog.__init__" /> <keyword name="VariableDetailDialog (Module)" id="VariableDetailDialog (Module)" ref="eric6.Debugger.VariableDetailDialog.html" /> @@ -13563,14 +13594,19 @@ <keyword name="normalizeCode" id="normalizeCode" ref="eric6.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheck.html#normalizeCode" /> <keyword name="normalizeCode" id="normalizeCode" ref="eric6.Plugins.CheckerPlugins.SyntaxChecker.jsCheckSyntax.html#normalizeCode" /> <keyword name="normalize_paths" id="normalize_paths" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#normalize_paths" /> + <keyword name="normalize_ws" id="normalize_ws" ref="eric6.E5Network.E5RFC6266.html#normalize_ws" /> <keyword name="normcaseabspath" id="normcaseabspath" ref="eric6.Utilities.__init__.html#normcaseabspath" /> <keyword name="normcasepath" id="normcasepath" ref="eric6.Utilities.__init__.html#normcasepath" /> <keyword name="normjoinpath" id="normjoinpath" ref="eric6.Utilities.__init__.html#normjoinpath" /> <keyword name="okToClearData" id="okToClearData" ref="eric6.E5Gui.E5MessageBox.html#okToClearData" /> <keyword name="open" id="open" ref="eric6.Utilities.compatibility_fixes.html#open" /> + <keyword name="parseContentDisposition" id="parseContentDisposition" ref="eric6.Helpviewer.HelpUtilities.html#parseContentDisposition" /> <keyword name="parseEnvironmentString" id="parseEnvironmentString" ref="eric6.Utilities.__init__.html#parseEnvironmentString" /> <keyword name="parseOptionString" id="parseOptionString" ref="eric6.Utilities.__init__.html#parseOptionString" /> <keyword name="parseString" id="parseString" ref="eric6.Utilities.__init__.html#parseString" /> + <keyword name="parse_ext_value" id="parse_ext_value" ref="eric6.E5Network.E5RFC6266.html#parse_ext_value" /> + <keyword name="parse_headers" id="parse_headers" ref="eric6.E5Network.E5RFC6266.html#parse_headers" /> + <keyword name="parse_headers_1" id="parse_headers_1" ref="eric6.E5Network.E5RFC6266.html#parse_headers_1" /> <keyword name="parse_udiff" id="parse_udiff" ref="eric6.Plugins.CheckerPlugins.CodeStyleChecker.pep8.html#parse_udiff" /> <keyword name="patch_modpython (Module)" id="patch_modpython (Module)" ref="eric6.patch_modpython.html" /> <keyword name="pbkdf2" id="pbkdf2" ref="eric6.Utilities.crypto.py3PBKDF2.html#pbkdf2" /> @@ -13911,6 +13947,7 @@ <file>eric6.E5Network.E5NetworkHeaderDetailsDialog.html</file> <file>eric6.E5Network.E5NetworkMonitor.html</file> <file>eric6.E5Network.E5NetworkProxyFactory.html</file> + <file>eric6.E5Network.E5RFC6266.html</file> <file>eric6.E5Network.E5SslCertificatesDialog.html</file> <file>eric6.E5Network.E5SslCertificatesInfoDialog.html</file> <file>eric6.E5Network.E5SslCertificatesInfoWidget.html</file>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Documentation/Source/eric6.E5Network.E5RFC6266.html Sat Jul 18 16:50:24 2015 +0200 @@ -0,0 +1,769 @@ +<!DOCTYPE html> +<html><head> +<title>eric6.E5Network.E5RFC6266</title> +<meta charset="UTF-8"> +<style> +body { + background: #EDECE6; + margin: 0em 1em 10em 1em; + color: black; +} + +h1 { color: white; background: #85774A; } +h2 { color: white; background: #85774A; } +h3 { color: white; background: #9D936E; } +h4 { color: white; background: #9D936E; } + +a { color: #BA6D36; } + +</style> +</head> +<body><a NAME="top" ID="top"></a> +<h1>eric6.E5Network.E5RFC6266</h1> +<p> +Module implementing a Content-Disposition parser iaw. RFC 6266. +</p> +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Classes</h3> +<table> +<tr> +<td><a href="#Charset">Charset</a></td> +<td>A charset (RFC5987, Section 3.2.1).</td> +</tr><tr> +<td><a href="#ContentDisposition">ContentDisposition</a></td> +<td>Records various indications and hints about content disposition.</td> +</tr><tr> +<td><a href="#ContentDispositionValue">ContentDispositionValue</a></td> +<td>A complete Content-Disposition value (RFC 6266, Section 4.1).</td> +</tr><tr> +<td><a href="#ContentDisposition_1">ContentDisposition</a></td> +<td>Records various indications and hints about content disposition.</td> +</tr><tr> +<td><a href="#DispositionParm">DispositionParm</a></td> +<td>A parameter for the Disposition-Type header (RFC6266, Section 4.1).</td> +</tr><tr> +<td><a href="#DispositionParmList">DispositionParmList</a></td> +<td>A list of disposition parameters (RFC6266, Section 4.1).</td> +</tr><tr> +<td><a href="#DispositionType">DispositionType</a></td> +<td>The disposition type (RFC6266, Section 4.1).</td> +</tr><tr> +<td><a href="#DuplicateParamError">DuplicateParamError</a></td> +<td>Exception raised when a parameter has been given twice.</td> +</tr><tr> +<td><a href="#ExtDispositionParm">ExtDispositionParm</a></td> +<td>An extended parameter (RFC6266, Section 4.1).</td> +</tr><tr> +<td><a href="#ExtToken">ExtToken</a></td> +<td>A token introducing an extended value (RFC 6266, Section 4.1).</td> +</tr><tr> +<td><a href="#ExtValue">ExtValue</a></td> +<td>An ext-value of an attribute (RFC 5987, Section 3.2).</td> +</tr><tr> +<td><a href="#InvalidISO8859Error">InvalidISO8859Error</a></td> +<td>Exception raised when a byte is invalid in ISO-8859-1.</td> +</tr><tr> +<td><a href="#Language">Language</a></td> +<td>A language-tag (RFC 5646, Section 2.1).</td> +</tr><tr> +<td><a href="#NoExtToken">NoExtToken</a></td> +<td>A token introducing a normal value (RFC 6266, Section 4.1).</td> +</tr><tr> +<td><a href="#QuotedString">QuotedString</a></td> +<td>A quoted string (RFC 2616, Section 2.2).</td> +</tr><tr> +<td><a href="#Token">Token</a></td> +<td>A token (RFC 2616, Section 2.2).</td> +</tr><tr> +<td><a href="#UniqueNamespace">UniqueNamespace</a></td> +<td>A pyPEG2 namespace which prevents setting a value twice.</td> +</tr><tr> +<td><a href="#Value">Value</a></td> +<td>A value.</td> +</tr><tr> +<td><a href="#ValueChars">ValueChars</a></td> +<td>A value of an attribute.</td> +</tr> +</table> +<h3>Functions</h3> +<table> +<tr> +<td><a href="#normalize_ws">normalize_ws</a></td> +<td>Do LWS (linear whitespace) folding.</td> +</tr><tr> +<td><a href="#parse_ext_value">parse_ext_value</a></td> +<td>Parse the value of an extended attribute.</td> +</tr><tr> +<td><a href="#parse_headers">parse_headers</a></td> +<td>Build a ContentDisposition from header values.</td> +</tr><tr> +<td><a href="#parse_headers_1">parse_headers</a></td> +<td>Build a ContentDisposition from header values.</td> +</tr> +</table> +<hr /><hr /> +<a NAME="Charset" ID="Charset"></a> +<h2>Charset</h2> +<p> + A charset (RFC5987, Section 3.2.1). +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ContentDisposition" ID="ContentDisposition"></a> +<h2>ContentDisposition</h2> +<p> + Records various indications and hints about content disposition. +</p><p> + These can be used to know if a file should be downloaded or + displayed directly, and to hint what filename it should have + in the download case. +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#ContentDisposition.__init__">ContentDisposition</a></td> +<td>Used internally after parsing the header.</td> +</tr><tr> +<td><a href="#ContentDisposition.filename">filename</a></td> +<td>The filename from the Content-Disposition header or None.</td> +</tr><tr> +<td><a href="#ContentDisposition.is_inline">is_inline</a></td> +<td>Return if the file should be handled inline.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="ContentDisposition.__init__" ID="ContentDisposition.__init__"></a> +<h4>ContentDisposition (Constructor)</h4> +<b>ContentDisposition</b>(<i>disposition='inline', assocs=None</i>) +<p> + Used internally after parsing the header. +</p><p> + Instances should generally be created from a factory + function, such as parse_headers and its variants. +</p><a NAME="ContentDisposition.filename" ID="ContentDisposition.filename"></a> +<h4>ContentDisposition.filename</h4> +<b>filename</b>(<i></i>) +<p> + The filename from the Content-Disposition header or None. +</p><p> + On safety: + This property records the intent of the sender. +</p><p> + You shouldn't use this sender-controlled value as a filesystem + path, it can be insecure. Serving files with this filename can be + dangerous as well, due to a certain browser using the part after + the dot for mime-sniffing. Saving it to a database is fine by + itself though. +</p><a NAME="ContentDisposition.is_inline" ID="ContentDisposition.is_inline"></a> +<h4>ContentDisposition.is_inline</h4> +<b>is_inline</b>(<i></i>) +<p> + Return if the file should be handled inline. +</p><p> + If not, and unless your application supports other dispositions + than the standard inline and attachment, it should be handled + as an attachment. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ContentDispositionValue" ID="ContentDispositionValue"></a> +<h2>ContentDispositionValue</h2> +<p> + A complete Content-Disposition value (RFC 6266, Section 4.1). +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ContentDisposition_1" ID="ContentDisposition_1"></a> +<h2>ContentDisposition</h2> +<p> + Records various indications and hints about content disposition. +</p><p> + These can be used to know if a file should be downloaded or + displayed directly, and to hint what filename it should have + in the download case. +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#ContentDisposition_1.__init__">ContentDisposition</a></td> +<td>Constructor</td> +</tr><tr> +<td><a href="#ContentDisposition_1.filename">filename</a></td> +<td>Public method to get the stored file name</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="ContentDisposition_1.__init__" ID="ContentDisposition_1.__init__"></a> +<h4>ContentDisposition (Constructor)</h4> +<b>ContentDisposition</b>(<i>filename</i>) +<p> + Constructor +</p><dl> +<dt><i>filename</i> (str)</dt> +<dd> +file name to be stored in this surrogate class +</dd> +</dl><a NAME="ContentDisposition_1.filename" ID="ContentDisposition_1.filename"></a> +<h4>ContentDisposition.filename</h4> +<b>filename</b>(<i></i>) +<p> + Public method to get the stored file name +</p><dl> +<dt>Returns:</dt> +<dd> +file name +</dd> +</dl><dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="DispositionParm" ID="DispositionParm"></a> +<h2>DispositionParm</h2> +<p> + A parameter for the Disposition-Type header (RFC6266, Section 4.1). +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="DispositionParmList" ID="DispositionParmList"></a> +<h2>DispositionParmList</h2> +<p> + A list of disposition parameters (RFC6266, Section 4.1). +</p> +<h3>Derived from</h3> +UniqueNamespace +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="DispositionType" ID="DispositionType"></a> +<h2>DispositionType</h2> +<p> + The disposition type (RFC6266, Section 4.1). +</p> +<h3>Derived from</h3> +peg.List +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="DuplicateParamError" ID="DuplicateParamError"></a> +<h2>DuplicateParamError</h2> +<p> + Exception raised when a parameter has been given twice. +</p> +<h3>Derived from</h3> +Exception +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ExtDispositionParm" ID="ExtDispositionParm"></a> +<h2>ExtDispositionParm</h2> +<p> + An extended parameter (RFC6266, Section 4.1). +</p> +<h3>Derived from</h3> +None +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#ExtDispositionParm.__init__">ExtDispositionParm</a></td> +<td></td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="ExtDispositionParm.__init__" ID="ExtDispositionParm.__init__"></a> +<h4>ExtDispositionParm (Constructor)</h4> +<b>ExtDispositionParm</b>(<i>value, name=None</i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ExtToken" ID="ExtToken"></a> +<h2>ExtToken</h2> +<p> + A token introducing an extended value (RFC 6266, Section 4.1). +</p> +<h3>Derived from</h3> +peg.Symbol +<h3>Class Attributes</h3> +<table> +<tr><td>regex</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#ExtToken.__str__">__str__</a></td> +<td></td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="ExtToken.__str__" ID="ExtToken.__str__"></a> +<h4>ExtToken.__str__</h4> +<b>__str__</b>(<i></i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ExtValue" ID="ExtValue"></a> +<h2>ExtValue</h2> +<p> + An ext-value of an attribute (RFC 5987, Section 3.2). +</p> +<h3>Derived from</h3> +peg.List +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="InvalidISO8859Error" ID="InvalidISO8859Error"></a> +<h2>InvalidISO8859Error</h2> +<p> + Exception raised when a byte is invalid in ISO-8859-1. +</p> +<h3>Derived from</h3> +Exception +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="Language" ID="Language"></a> +<h2>Language</h2> +<p> + A language-tag (RFC 5646, Section 2.1). +</p><p> + Fixme: This grammar is not 100% correct yet. + https://github.com/The-Compiler/qutebrowser/issues/105 +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="NoExtToken" ID="NoExtToken"></a> +<h2>NoExtToken</h2> +<p> + A token introducing a normal value (RFC 6266, Section 4.1). +</p> +<h3>Derived from</h3> +peg.Symbol +<h3>Class Attributes</h3> +<table> +<tr><td>regex</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#NoExtToken.__str__">__str__</a></td> +<td></td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="NoExtToken.__str__" ID="NoExtToken.__str__"></a> +<h4>NoExtToken.__str__</h4> +<b>__str__</b>(<i></i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="QuotedString" ID="QuotedString"></a> +<h2>QuotedString</h2> +<p> + A quoted string (RFC 2616, Section 2.2). +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#QuotedString.__str__">__str__</a></td> +<td></td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="QuotedString.__str__" ID="QuotedString.__str__"></a> +<h4>QuotedString.__str__</h4> +<b>__str__</b>(<i></i>) + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="Token" ID="Token"></a> +<h2>Token</h2> +<p> + A token (RFC 2616, Section 2.2). +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="UniqueNamespace" ID="UniqueNamespace"></a> +<h2>UniqueNamespace</h2> +<p> + A pyPEG2 namespace which prevents setting a value twice. +</p> +<h3>Derived from</h3> +peg.Namespace +<h3>Class Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr> +<td><a href="#UniqueNamespace.__setitem__">__setitem__</a></td> +<td>Special method to set an item.</td> +</tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<a NAME="UniqueNamespace.__setitem__" ID="UniqueNamespace.__setitem__"></a> +<h4>UniqueNamespace.__setitem__</h4> +<b>__setitem__</b>(<i>key, value</i>) +<p> + Special method to set an item. +</p><dl> +<dt><i>key</i></dt> +<dd> +key for the item +</dd><dt><i>value</i></dt> +<dd> +value of the item +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="Value" ID="Value"></a> +<h2>Value</h2> +<p> + A value. (RFC 2616, Section 3.6). +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="ValueChars" ID="ValueChars"></a> +<h2>ValueChars</h2> +<p> + A value of an attribute. +</p><p> + Fixme: Can we merge this with Value? + https://github.com/The-Compiler/qutebrowser/issues/105 +</p> +<h3>Derived from</h3> +str +<h3>Class Attributes</h3> +<table> +<tr><td>grammar</td></tr> +</table> +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Methods</h3> +<table> +<tr><td>None</td></tr> +</table> +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="normalize_ws" ID="normalize_ws"></a> +<h2>normalize_ws</h2> +<b>normalize_ws</b>(<i>text</i>) +<p> + Do LWS (linear whitespace) folding. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="parse_ext_value" ID="parse_ext_value"></a> +<h2>parse_ext_value</h2> +<b>parse_ext_value</b>(<i>val</i>) +<p> + Parse the value of an extended attribute. +</p> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="parse_headers" ID="parse_headers"></a> +<h2>parse_headers</h2> +<b>parse_headers</b>(<i>content_disposition</i>) +<p> + Build a ContentDisposition from header values. +</p><dl> +<dt><i>content_disposition</i> (bytes)</dt> +<dd> +contents of the disposition header +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="parse_headers_1" ID="parse_headers_1"></a> +<h2>parse_headers</h2> +<b>parse_headers</b>(<i>content_disposition</i>) +<p> + Build a ContentDisposition from header values. +</p><dl> +<dt><i>content_disposition</i> (bytes)</dt> +<dd> +contents of the disposition header +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html> \ No newline at end of file
--- a/Documentation/Source/eric6.Helpviewer.HelpUtilities.html Sat Jul 18 15:14:28 2015 +0200 +++ b/Documentation/Source/eric6.Helpviewer.HelpUtilities.html Sat Jul 18 16:50:24 2015 +0200 @@ -42,6 +42,9 @@ </tr><tr> <td><a href="#getFileNameFromUrl">getFileNameFromUrl</a></td> <td>Module function to generate a file name based on the given URL.</td> +</tr><tr> +<td><a href="#parseContentDisposition">parseContentDisposition</a></td> +<td>Function to parse a content disposition header.</td> </tr> </table> <hr /><hr /> @@ -102,5 +105,18 @@ </dd> </dl> <div align="right"><a href="#top">Up</a></div> +<hr /><hr /> +<a NAME="parseContentDisposition" ID="parseContentDisposition"></a> +<h2>parseContentDisposition</h2> +<b>parseContentDisposition</b>(<i>reply</i>) +<p> + Function to parse a content disposition header. +</p><dl> +<dt><i>reply</i> (QNetworkReply)</dt> +<dd> +network reply to be parsed +</dd> +</dl> +<div align="right"><a href="#top">Up</a></div> <hr /> </body></html> \ No newline at end of file
--- a/Documentation/Source/index-eric6.E5Network.html Sat Jul 18 15:14:28 2015 +0200 +++ b/Documentation/Source/index-eric6.E5Network.html Sat Jul 18 16:50:24 2015 +0200 @@ -40,6 +40,9 @@ <td><a href="eric6.E5Network.E5NetworkProxyFactory.html">E5NetworkProxyFactory</a></td> <td>Module implementing a network proxy factory.</td> </tr><tr> +<td><a href="eric6.E5Network.E5RFC6266.html">E5RFC6266</a></td> +<td>Module implementing a Content-Disposition parser iaw.</td> +</tr><tr> <td><a href="eric6.E5Network.E5SslCertificatesDialog.html">E5SslCertificatesDialog</a></td> <td>Module implementing a dialog to show and edit all certificates.</td> </tr><tr>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/E5Network/E5RFC6266.py Sat Jul 18 16:50:24 2015 +0200 @@ -0,0 +1,360 @@ +# -*- coding: utf-8 -*- + +# Copyright (c) 2015 Detlev Offenbach <detlev@die-offenbachs.de> +# + +""" +Module implementing a Content-Disposition parser iaw. RFC 6266. +""" + +# +# This code is adapted from the rfc6266.py module of qutebrowser. +# Original copyright 2014-2015 Florian Bruhin (The Compiler) +# <mail@qutebrowser.org> +# + +from __future__ import unicode_literals + +try: # Py3 + import urllib.parse as parse +except (ImportError): + import urlparse as parse # __IGNORE_WARNING__ +import collections +import string +import re + +try: + import pypeg2 as peg + + class UniqueNamespace(peg.Namespace): + """ + A pyPEG2 namespace which prevents setting a value twice. + """ + def __setitem__(self, key, value): + """ + Special method to set an item. + + @param key key for the item + @param value value of the item + """ + if key in self: + raise DuplicateParamError(key) + super().__setitem__(key, value) + + # RFC 2616 + separator_chars = "()<>@,;:\\\"/[]?={} \t" + ctl_chars = ''.join(chr(i) for i in range(32)) + chr(127) + nontoken_chars = separator_chars + ctl_chars + + # RFC 5987 + attr_chars_nonalnum = '!#$&+-.^_`|~' + attr_chars = string.ascii_letters + string.digits + attr_chars_nonalnum + + # RFC 5987 gives this alternative construction of the token character class + token_chars = attr_chars + "*'%" + + # Definitions from https://tools.ietf.org/html/rfc2616#section-2.2 + # token was redefined from attr_chars to avoid using AnyBut, + # which might include non-ascii octets. + token_re = '[{}]+'.format(re.escape(token_chars)) + + class Token(str): + """ + A token (RFC 2616, Section 2.2). + """ + grammar = re.compile(token_re) + + # RFC 2616 says some linear whitespace (LWS) is in fact allowed in text + # and qdtext; however it also mentions folding that whitespace into + # a single SP (which isn't in CTL) before interpretation. + # Assume the caller already that folding when parsing headers. + + # Note: qdtext also allows non-ascii, which we choose to parse + # as ISO-8859-1; rejecting it entirely would also be permitted. + # Some broken browsers attempt encoding-sniffing, which is broken + # because the spec only allows iso, and because encoding-sniffing + # can mangle valid values. + # Everything else in this grammar (including RFC 5987 ext values) + # is in an ascii-safe encoding. + + qdtext_re = r'[^"{}]'.format(re.escape(ctl_chars)) + quoted_pair_re = r'\\[{}]'.format(re.escape( + ''.join(chr(i) for i in range(128)))) + + class QuotedString(str): + """ + A quoted string (RFC 2616, Section 2.2). + """ + grammar = re.compile(r'"({}|{})+"'.format(quoted_pair_re, qdtext_re)) + + def __str__(self): + s = super().__str__() + s = s[1:-1] # remove quotes + s = re.sub(r'\\(.)', r'\1', s) # drop backslashes + return s + + class Value(str): + """ + A value. (RFC 2616, Section 3.6). + """ + grammar = [re.compile(token_re), QuotedString] + + class Charset(str): + """ + A charset (RFC5987, Section 3.2.1). + """ + # Other charsets are forbidden, the spec reserves them + # for future evolutions. + grammar = re.compile('UTF-8|ISO-8859-1', re.I) + + class Language(str): + """ + A language-tag (RFC 5646, Section 2.1). + + Fixme: This grammar is not 100% correct yet. + https://github.com/The-Compiler/qutebrowser/issues/105 + """ + grammar = re.compile('[A-Za-z0-9-]+') + + attr_char_re = '[{}]'.format(re.escape(attr_chars)) + hex_digit_re = '%[' + string.hexdigits + ']{2}' + + class ValueChars(str): + """ + A value of an attribute. + + Fixme: Can we merge this with Value? + https://github.com/The-Compiler/qutebrowser/issues/105 + """ + grammar = re.compile('({}|{})*'.format(attr_char_re, hex_digit_re)) + + class ExtValue(peg.List): + """ + An ext-value of an attribute (RFC 5987, Section 3.2). + """ + grammar = peg.contiguous(Charset, "'", peg.optional(Language), "'", + ValueChars) + + class ExtToken(peg.Symbol): + """ + A token introducing an extended value (RFC 6266, Section 4.1). + """ + regex = re.compile(token_re + r'\*') + + def __str__(self): + return super().__str__().lower() + + class NoExtToken(peg.Symbol): + """ + A token introducing a normal value (RFC 6266, Section 4.1). + """ + regex = re.compile(token_re + r'(?<!\*)') + + def __str__(self): + return super().__str__().lower() + + class DispositionParm(str): + """ + A parameter for the Disposition-Type header (RFC6266, Section 4.1). + """ + grammar = peg.attr('name', NoExtToken), '=', Value + + class ExtDispositionParm: + """ + An extended parameter (RFC6266, Section 4.1). + """ + grammar = peg.attr('name', ExtToken), '=', ExtValue + + def __init__(self, value, name=None): + self.name = name + self.value = value + + class DispositionType(peg.List): + """ + The disposition type (RFC6266, Section 4.1). + """ + grammar = [re.compile('(inline|attachment)', re.I), Token] + + class DispositionParmList(UniqueNamespace): + """ + A list of disposition parameters (RFC6266, Section 4.1). + """ + grammar = peg.maybe_some(';', [ExtDispositionParm, DispositionParm]) + + class ContentDispositionValue: + """ + A complete Content-Disposition value (RFC 6266, Section 4.1). + """ + # Allows nonconformant final semicolon + # I've seen it in the wild, and browsers accept it + # http://greenbytes.de/tech/tc2231/#attwithasciifilenamenqs + grammar = (peg.attr('dtype', DispositionType), + peg.attr('params', DispositionParmList), + peg.optional(';')) + + LangTagged = collections.namedtuple('LangTagged', ['string', 'langtag']) + + class DuplicateParamError(Exception): + """ + Exception raised when a parameter has been given twice. + """ + + class InvalidISO8859Error(Exception): + """ + Exception raised when a byte is invalid in ISO-8859-1. + """ + + class ContentDisposition: + """ + Records various indications and hints about content disposition. + + These can be used to know if a file should be downloaded or + displayed directly, and to hint what filename it should have + in the download case. + """ + def __init__(self, disposition='inline', assocs=None): + """ + Used internally after parsing the header. + + Instances should generally be created from a factory + function, such as parse_headers and its variants. + """ + if len(disposition) != 1: + self.disposition = 'inline' + else: + self.disposition = disposition[0] + if assocs is None: + self.assocs = {} + else: + self.assocs = dict(assocs) # So we can change values + if 'filename*' in self.assocs: + param = self.assocs['filename*'] + assert isinstance(param, ExtDispositionParm) + self.assocs['filename*'] = \ + parse_ext_value(param.value).string + + def filename(self): + """ + The filename from the Content-Disposition header or None. + + On safety: + This property records the intent of the sender. + + You shouldn't use this sender-controlled value as a filesystem + path, it can be insecure. Serving files with this filename can be + dangerous as well, due to a certain browser using the part after + the dot for mime-sniffing. Saving it to a database is fine by + itself though. + """ + if 'filename*' in self.assocs: + return self.assocs['filename*'] + elif 'filename' in self.assocs: + # XXX Reject non-ascii (parsed via qdtext) here? + return self.assocs['filename'] + + def is_inline(self): + """ + Return if the file should be handled inline. + + If not, and unless your application supports other dispositions + than the standard inline and attachment, it should be handled + as an attachment. + """ + return self.disposition.lower() == 'inline' + + def normalize_ws(text): + """ + Do LWS (linear whitespace) folding. + """ + return ' '.join(text.split()) + + def parse_headers(content_disposition): + """ + Build a ContentDisposition from header values. + + @param content_disposition contents of the disposition header + @type bytes + """ + # We allow non-ascii here (it will only be parsed inside of qdtext, and + # rejected by the grammar if it appears in other places), although + # parsing it can be ambiguous. Parsing it ensures that a non-ambiguous + # filename* value won't get dismissed because of an unrelated ambiguity + # in the filename parameter. But it does mean we occasionally give + # less-than-certain values for some legacy senders. + content_disposition = content_disposition.decode('iso-8859-1') + + # Our parsing is relaxed in these regards: + # - The grammar allows a final ';' in the header; + # - We do LWS-folding, and possibly normalise other broken + # whitespace, instead of rejecting non-lws-safe text. + # XXX Would prefer to accept only the quoted whitespace + # case, rather than normalising everything. + content_disposition = normalize_ws(content_disposition) + try: + parsed = peg.parse(content_disposition, ContentDispositionValue) + except (SyntaxError, DuplicateParamError, InvalidISO8859Error): + return ContentDisposition() + else: + return ContentDisposition(disposition=parsed.dtype, + assocs=parsed.params) + + def parse_ext_value(val): + """ + Parse the value of an extended attribute. + """ + if len(val) == 3: + charset, langtag, coded = val + else: + charset, coded = val + langtag = None + decoded = parse.unquote(coded, charset, errors='strict') + if charset == 'iso-8859-1': + # Fail if the filename contains an invalid ISO-8859-1 char + for c in decoded: + if 0x7F <= ord(c) <= 0x9F: + raise InvalidISO8859Error(c) + return LangTagged(decoded, langtag) + +except ImportError: + class ContentDisposition: + """ + Records various indications and hints about content disposition. + + These can be used to know if a file should be downloaded or + displayed directly, and to hint what filename it should have + in the download case. + """ + def __init__(self, filename): + """ + Constructor + + @param filename file name to be stored in this surrogate class + @type str + """ + self.__filename = filename + + def filename(self): + """ + Public method to get the stored file name + + @return file name + @rtype str + """ + return self.__filename + + def parse_headers(content_disposition): + """ + Build a ContentDisposition from header values. + + @param content_disposition contents of the disposition header + @type bytes + """ + header = content_disposition.decode() + if header: + pos = header.find("filename=") + if pos != -1: + path = header[pos + 9:] + if path.startswith('"') and path.endswith('"'): + path = path[1:-1] + return ContentDisposition(path) + return ContentDisposition("")
--- a/E5Network/E5SslUtilities.py Sat Jul 18 15:14:28 2015 +0200 +++ b/E5Network/E5SslUtilities.py Sat Jul 18 16:50:24 2015 +0200 @@ -7,6 +7,8 @@ Module implementing SSL utility functions. """ +from __future__ import unicode_literals + from PyQt5.QtCore import qVersion def initSSL():
--- a/Helpviewer/Download/DownloadItem.py Sat Jul 18 15:14:28 2015 +0200 +++ b/Helpviewer/Download/DownloadItem.py Sat Jul 18 16:50:24 2015 +0200 @@ -24,6 +24,7 @@ from .Ui_DownloadItem import Ui_DownloadItem from .DownloadUtilities import timeString, dataString +from ..HelpUtilities import parseContentDisposition import UI.PixmapCache import Preferences @@ -269,26 +270,27 @@ @param directory name of the directory to store the file into (string) @return proposed filename and original filename (string, string) """ - path = "" - if self.__reply.hasRawHeader("Content-Disposition"): - header = bytes(self.__reply.rawHeader("Content-Disposition"))\ - .decode() - if header: - pos = header.find("filename=") - if pos != -1: - path = header[pos + 9:] - if path.startswith('"') and path.endswith('"'): - path = path[1:-1] - if not path: - path = self.__url.path() - +## path = "" +## if self.__reply.hasRawHeader("Content-Disposition"): +## header = bytes(self.__reply.rawHeader("Content-Disposition"))\ +## .decode() +## if header: +## pos = header.find("filename=") +## if pos != -1: +## path = header[pos + 9:] +## if path.startswith('"') and path.endswith('"'): +## path = path[1:-1] +## if not path: +## path = self.__url.path() +## + path = parseContentDisposition(self.__reply) info = QFileInfo(path) baseName = info.completeBaseName() endName = info.suffix() - if not baseName: - baseName = "unnamed_download" - +## if not baseName: +## baseName = "unnamed_download" +## origName = baseName if endName: origName += '.' + endName
--- a/Helpviewer/HelpUtilities.py Sat Jul 18 15:14:28 2015 +0200 +++ b/Helpviewer/HelpUtilities.py Sat Jul 18 16:50:24 2015 +0200 @@ -82,3 +82,27 @@ i += 1 return tmpFileName + + +def parseContentDisposition(reply): + """ + Function to parse a content disposition header. + + @param reply network reply to be parsed + @type QNetworkReply + """ + path = "" + # step 1: check the content disposition header for a file name + if reply.hasRawHeader("Content-Disposition"): + from E5Network.E5RFC6266 import parse_headers + contentDisposition = parse_headers( + bytes(reply.rawHeader("Content-Disposition"))) + path = contentDisposition.filename() + # step 2: get file name from URL + if not path: + path = reply.url().path() + # step 3: give a generic file name + if not path: + path = "unnamed_download" + + return os.path.basename(path)
--- a/changelog Sat Jul 18 15:14:28 2015 +0200 +++ b/changelog Sat Jul 18 16:50:24 2015 +0200 @@ -55,6 +55,8 @@ --- enhanced the status dialog functionality by a diff view - Web Browser -- added support for feature permissions + -- improved parsing of the content disposition header analog to + the way it is done in qutebrowser - Third Party packages -- updated Pygments to 2.0.2
--- a/eric6.e4p Sat Jul 18 15:14:28 2015 +0200 +++ b/eric6.e4p Sat Jul 18 16:50:24 2015 +0200 @@ -195,6 +195,7 @@ <Source>E5Network/E5NetworkHeaderDetailsDialog.py</Source> <Source>E5Network/E5NetworkMonitor.py</Source> <Source>E5Network/E5NetworkProxyFactory.py</Source> + <Source>E5Network/E5RFC6266.py</Source> <Source>E5Network/E5SslCertificatesDialog.py</Source> <Source>E5Network/E5SslCertificatesInfoDialog.py</Source> <Source>E5Network/E5SslCertificatesInfoWidget.py</Source>