Ported to PyQt5 and eric6.

Fri, 11 Jul 2014 19:49:18 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 11 Jul 2014 19:49:18 +0200
changeset 11
3b7ec819a55d
parent 9
100cd707c50a
child 13
078cfd486432

Ported to PyQt5 and eric6.

.hgignore file | annotate | diff | comparison | revisions
ChangeLog file | annotate | diff | comparison | revisions
ColorString.e4p file | annotate | diff | comparison | revisions
ColorString/ColorSelectionDialog.py file | annotate | diff | comparison | revisions
ColorString/i18n/colorstring_de.ts file | annotate | diff | comparison | revisions
ColorString/i18n/colorstring_en.ts file | annotate | diff | comparison | revisions
ColorString/i18n/colorstring_es.ts file | annotate | diff | comparison | revisions
PluginColorString.py file | annotate | diff | comparison | revisions
PluginColorString.zip file | annotate | diff | comparison | revisions
--- a/.hgignore	Sat Apr 26 15:38:51 2014 +0200
+++ b/.hgignore	Fri Jul 11 19:49:18 2014 +0200
@@ -1,3 +1,5 @@
+glob:.eric6project
+glob:_eric6project
 glob:.eric5project
 glob:_eric5project
 glob:.eric4project
--- a/ChangeLog	Sat Apr 26 15:38:51 2014 +0200
+++ b/ChangeLog	Fri Jul 11 19:49:18 2014 +0200
@@ -1,5 +1,8 @@
 ChangeLog
 ---------
+Version 2.0.0:
+- ported for eric6 using PyQt5
+
 Version 1.0.0:
 - first stable release
 
--- a/ColorString.e4p	Sat Apr 26 15:38:51 2014 +0200
+++ b/ColorString.e4p	Fri Jul 11 19:49:18 2014 +0200
@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Project SYSTEM "Project-5.1.dtd">
-<!-- eric5 project file for project ColorString -->
+<!-- eric6 project file for project ColorString -->
+<!-- Copyright (C) 2014 Detlev Offenbach, detlev@die-offenbachs.de -->
 <Project version="5.1">
   <Language>en_US</Language>
   <Hash>bf7dfc760db7f57239ae96b215ea79bb0df717d5</Hash>
   <ProgLanguage mixed="0">Python3</ProgLanguage>
-  <ProjectType>E4Plugin</ProjectType>
+  <ProjectType>E6Plugin</ProjectType>
   <Description>Plug-in to select a color via a color selection dialog and insert it as a string at the current editor cursor position. Selected text is used to initialize the dialog and is replaced with the new color.
 </Description>
   <Version>0.1</Version>
@@ -172,7 +173,7 @@
               <string>cssFile</string>
             </key>
             <value>
-              <string>%PYTHON%/eric5/CSSs/default.css</string>
+              <string>%PYTHON%/eric6/CSSs/default.css</string>
             </value>
             <key>
               <string>ignoreDirectories</string>
@@ -184,6 +185,8 @@
                 <string>.ropeproject</string>
                 <string>_ropeproject</string>
                 <string>.hg</string>
+                <string>.eric6project</string>
+                <string>_eric6project</string>
               </list>
             </value>
             <key>
@@ -231,4 +234,83 @@
       </dict>
     </DocumentationParams>
   </Documentation>
+  <Checkers>
+    <CheckersParams>
+      <dict>
+        <key>
+          <string>Pep8Checker</string>
+        </key>
+        <value>
+          <dict>
+            <key>
+              <string>DocstringType</string>
+            </key>
+            <value>
+              <string>eric</string>
+            </value>
+            <key>
+              <string>ExcludeFiles</string>
+            </key>
+            <value>
+              <string>*/Ui_*.py</string>
+            </value>
+            <key>
+              <string>ExcludeMessages</string>
+            </key>
+            <value>
+              <string>W293, N802, N803, N807, N808, N821,E265</string>
+            </value>
+            <key>
+              <string>FixCodes</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
+              <string>FixIssues</string>
+            </key>
+            <value>
+              <bool>False</bool>
+            </value>
+            <key>
+              <string>HangClosing</string>
+            </key>
+            <value>
+              <bool>False</bool>
+            </value>
+            <key>
+              <string>IncludeMessages</string>
+            </key>
+            <value>
+              <string></string>
+            </value>
+            <key>
+              <string>MaxLineLength</string>
+            </key>
+            <value>
+              <int>79</int>
+            </value>
+            <key>
+              <string>NoFixCodes</string>
+            </key>
+            <value>
+              <string>E501</string>
+            </value>
+            <key>
+              <string>RepeatMessages</string>
+            </key>
+            <value>
+              <bool>True</bool>
+            </value>
+            <key>
+              <string>ShowIgnored</string>
+            </key>
+            <value>
+              <bool>False</bool>
+            </value>
+          </dict>
+        </value>
+      </dict>
+    </CheckersParams>
+  </Checkers>
 </Project>
--- a/ColorString/ColorSelectionDialog.py	Sat Apr 26 15:38:51 2014 +0200
+++ b/ColorString/ColorSelectionDialog.py	Fri Jul 11 19:49:18 2014 +0200
@@ -7,7 +7,8 @@
 Module implementing a dialog to select a color by name.
 """
 
-from PyQt4.QtGui import QDialog, QColor, QPixmap, QIcon
+from PyQt5.QtGui import QColor, QPixmap, QIcon
+from PyQt5.QtWidgets import QDialog
 
 from .Ui_ColorSelectionDialog import Ui_ColorSelectionDialog
 
--- a/ColorString/i18n/colorstring_de.ts	Sat Apr 26 15:38:51 2014 +0200
+++ b/ColorString/i18n/colorstring_de.ts	Fri Jul 11 19:49:18 2014 +0200
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="de_DE">
+<!DOCTYPE TS><TS version="2.0" language="de_DE" sourcelanguage="">
 <context>
     <name>ColorSelectionDialog</name>
     <message>
@@ -22,17 +21,17 @@
 <context>
     <name>ColorStringPlugin</name>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>Color String</source>
         <translation>Farbzeichenkette</translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="218"/>
+        <location filename="../../PluginColorString.py" line="220"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color string. Aborting!&lt;/p&gt;</source>
         <translation>&lt;p&gt;Die ausgewählte Zeichenkette &lt;b&gt;{0}&lt;/b&gt; ist keine gültige Farbe. Abbruch!&lt;/p&gt;</translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color name. Aborting!&lt;/p&gt;</source>
         <translation>&lt;p&gt;Die ausgewählte Zeichenkette &lt;b&gt;{0}&lt;/b&gt; ist kein gültiger Farbname. Abbruch!&lt;/p&gt;</translation>
     </message>
--- a/ColorString/i18n/colorstring_en.ts	Sat Apr 26 15:38:51 2014 +0200
+++ b/ColorString/i18n/colorstring_en.ts	Fri Jul 11 19:49:18 2014 +0200
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.1" language="en_US">
+<!DOCTYPE TS><TS version="2.0" language="en_US" sourcelanguage="">
 <context>
     <name>ColorSelectionDialog</name>
     <message>
@@ -22,17 +21,17 @@
 <context>
     <name>ColorStringPlugin</name>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>Color String</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="218"/>
+        <location filename="../../PluginColorString.py" line="220"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color string. Aborting!&lt;/p&gt;</source>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color name. Aborting!&lt;/p&gt;</source>
         <translation type="unfinished"></translation>
     </message>
--- a/ColorString/i18n/colorstring_es.ts	Sat Apr 26 15:38:51 2014 +0200
+++ b/ColorString/i18n/colorstring_es.ts	Fri Jul 11 19:49:18 2014 +0200
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!DOCTYPE TS>
-<TS version="2.0" language="es_ES">
+<!DOCTYPE TS><TS version="2.0" language="es_ES" sourcelanguage="">
 <context>
     <name>ColorSelectionDialog</name>
     <message>
@@ -22,17 +21,17 @@
 <context>
     <name>ColorStringPlugin</name>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>Color String</source>
         <translation>Cadena de Color</translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="218"/>
+        <location filename="../../PluginColorString.py" line="220"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color string. Aborting!&lt;/p&gt;</source>
         <translation>&lt;p&gt;La cadena seleccionada&lt;b&gt;{0}&lt;/b&gt; no es una cadena de color válida. ¡Abortando!&lt;/p&gt;</translation>
     </message>
     <message>
-        <location filename="../../PluginColorString.py" line="267"/>
+        <location filename="../../PluginColorString.py" line="269"/>
         <source>&lt;p&gt;The selected string &lt;b&gt;{0}&lt;/b&gt; is not a valid color name. Aborting!&lt;/p&gt;</source>
         <translation>&lt;p&gt;La cadena seleccionada&lt;b&gt;{0}&lt;/b&gt; no es un nombre de color válido. ¡Abortando!&lt;/p&gt;</translation>
     </message>
--- a/PluginColorString.py	Sat Apr 26 15:38:51 2014 +0200
+++ b/PluginColorString.py	Fri Jul 11 19:49:18 2014 +0200
@@ -11,8 +11,9 @@
 
 import os
 
-from PyQt4.QtCore import QObject, QTranslator
-from PyQt4.QtGui import QColor, QColorDialog, QMenu, QDialog
+from PyQt5.QtCore import QObject, QTranslator
+from PyQt5.QtGui import QColor
+from PyQt5.QtWidgets import QColorDialog, QMenu, QDialog
 
 from E5Gui.E5Application import e5App
 from E5Gui import E5MessageBox
@@ -22,7 +23,7 @@
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "1.0.0"
+version = "2.0.0"
 className = "ColorStringPlugin"
 packageName = "ColorString"
 shortDescription = "Insert color as string"
@@ -179,7 +180,7 @@
         """
         isHex = True
         for c in text:
-            isHex = isHex and c in "0123456789abcdefABCDEF" 
+            isHex = isHex and c in "0123456789abcdefABCDEF"
         return isHex
     
     def __isValidColor(self, name):
@@ -217,9 +218,9 @@
             if not self.__isValidColor(currColor):
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Color String"),
-                    self.trUtf8(
-                        """<p>The selected string <b>{0}</b> is not a""" \
+                    self.tr("Color String"),
+                    self.tr(
+                        """<p>The selected string <b>{0}</b> is not a"""
                         """ valid color string. Aborting!</p>""")
                     .format(currColor))
                 return
@@ -265,9 +266,9 @@
             if currColor not in QColor.colorNames():
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Color String"),
-                    self.trUtf8(
-                        """<p>The selected string <b>{0}</b> is not a""" \
+                    self.tr("Color String"),
+                    self.tr(
+                        """<p>The selected string <b>{0}</b> is not a"""
                         """ valid color name. Aborting!</p>""")
                     .format(currColor))
                 return
Binary file PluginColorString.zip has changed

eric ide

mercurial