Utilities: optimized and fixed the assembly of version information.

Wed, 30 Sep 2020 19:50:33 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 30 Sep 2020 19:50:33 +0200
changeset 7729
f2f7b7b24879
parent 7728
a233627a5e25
child 7730
20b05e846148

Utilities: optimized and fixed the assembly of version information.

eric6/UI/EmailDialog.py file | annotate | diff | comparison | revisions
eric6/UI/UserInterface.py file | annotate | diff | comparison | revisions
eric6/Utilities/__init__.py file | annotate | diff | comparison | revisions
eric6/eric6.py file | annotate | diff | comparison | revisions
--- a/eric6/UI/EmailDialog.py	Wed Sep 30 19:36:46 2020 +0200
+++ b/eric6/UI/EmailDialog.py	Wed Sep 30 19:50:33 2020 +0200
@@ -224,7 +224,7 @@
         @return prepared mail message
         @rtype email.mime.text.MIMEText
         """
-        msgtext = "{0}\r\n----\r\n{1}----\r\n{2}----\r\n{3}".format(
+        msgtext = "{0}\r\n----\r\n{1}\r\n----\r\n{2}\r\n----\r\n{3}".format(
             self.message.toPlainText(),
             Utilities.generateVersionInfo("\r\n"),
             Utilities.generatePluginsVersionInfo("\r\n"),
@@ -249,7 +249,7 @@
                       "If you see this message, your mail client is not "
                       "capable of displaying the attachments.")
         
-        msgtext = "{0}\r\n----\r\n{1}----\r\n{2}----\r\n{3}".format(
+        msgtext = "{0}\r\n----\r\n{1}\r\n----\r\n{2}\r\n----\r\n{3}".format(
             self.message.toPlainText(),
             Utilities.generateVersionInfo("\r\n"),
             Utilities.generatePluginsVersionInfo("\r\n"),
--- a/eric6/UI/UserInterface.py	Wed Sep 30 19:36:46 2020 +0200
+++ b/eric6/UI/UserInterface.py	Wed Sep 30 19:50:33 2020 +0200
@@ -3699,7 +3699,7 @@
             if deleteAttachFile:
                 os.remove(attachFile)
         else:
-            body = "\r\n----\r\n{0}----\r\n{1}----\r\n{2}".format(
+            body = "\r\n----\r\n{0}\r\n----\r\n{1}\r\n----\r\n{2}".format(
                 Utilities.generateVersionInfo("\r\n"),
                 Utilities.generatePluginsVersionInfo("\r\n"),
                 Utilities.generateDistroInfo("\r\n"))
--- a/eric6/Utilities/__init__.py	Wed Sep 30 19:36:46 2020 +0200
+++ b/eric6/Utilities/__init__.py	Wed Sep 30 19:50:33 2020 +0200
@@ -1987,8 +1987,8 @@
         try:
             pm = app.getObject("PluginManager")
             versions = {}
-            for info in pm.getPluginInfos():
-                versions[info["module_name"]] = info["version"]
+            for pinfo in pm.getPluginInfos():
+                versions[pinfo["module_name"]] = pinfo["version"]
             
             info.append("Plugins Version Numbers:")
             for pluginModuleName in sorted(versions.keys()):
@@ -2022,8 +2022,8 @@
                 except IOError:
                     continue
                 
-                info.append(rfile)
-                info.extend(['  {0}'.format(line) for line in lines])
+                info.append('  {0}'.format(rfile))
+                info.extend(['    {0}'.format(line) for line in lines])
                 info.append("")
     
     return linesep.join(info)
--- a/eric6/eric6.py	Wed Sep 30 19:36:46 2020 +0200
+++ b/eric6/eric6.py	Wed Sep 30 19:50:33 2020 +0200
@@ -185,10 +185,10 @@
         separator, Utilities.generateVersionInfo())
     pluginVersionInfo = Utilities.generatePluginsVersionInfo()
     if pluginVersionInfo:
-        versionInfo += "{0}\n{1}".format(separator, pluginVersionInfo)
+        versionInfo += "\n{0}\n{1}".format(separator, pluginVersionInfo)
     distroInfo = Utilities.generateDistroInfo()
     if distroInfo:
-        versionInfo += "{0}\n{1}".format(separator, distroInfo)
+        versionInfo += "\n{0}\n{1}".format(separator, distroInfo)
     
     if isinstance(excType, str):
         tbinfo = tracebackobj
@@ -198,7 +198,8 @@
         tbinfofile.seek(0)
         tbinfo = tbinfofile.read()
     errmsg = '{0}: \n{1}'.format(str(excType), str(excValue))
-    sections = [separator, timeString, separator, errmsg, separator, tbinfo]
+    sections = ['', separator, timeString, separator, errmsg, separator,
+                tbinfo]
     msg = '\n'.join(sections)
     try:
         f = open(logFile, "w", encoding="utf-8")

eric ide

mercurial