Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Picard log entries have inaccurate timestamp (PICARD-45)

  • Loading branch information...
commit 7c6d08d1ae61fa28b504ad41663f5b8b0878c20a 1 parent b31e952
Michael Wiencek mwiencek authored
Showing with 10 additions and 8 deletions.
  1. +1 −0  NEWS.txt
  2. +5 −4 picard/log.py
  3. +4 −4 picard/ui/logview.py
1  NEWS.txt
View
@@ -21,6 +21,7 @@ Version 1.0 - 2012-06-XX
* Remove .DS_Store, desktop.ini, and Thumbs.db from otherwise empty directories (PICARD-75)
* Update artist translation to use new alias features (primary flag, sort names) (PICARD-200)
* Deleted tags aren't indicated as changes (PICARD-165)
+ * Picard log entries have inaccurate timestamp (PICARD-45)
Version 0.16 - 2011-10-23
* Added AcoustID support.
9 picard/log.py
View
@@ -24,8 +24,8 @@
from picard.util import thread
-def _stderr_receiver(prefix, msg):
- sys.stderr.write("%s %s %s %s%s" % (prefix, str(QtCore.QThread.currentThreadId()), str(QtCore.QTime.currentTime().toString()), msg, os.linesep))
+def _stderr_receiver(prefix, time, msg):
+ sys.stderr.write("%s %s %s %s%s" % (prefix, str(QtCore.QThread.currentThreadId()), time, msg, os.linesep))
class Log(object):
@@ -45,15 +45,16 @@ def _message(self, prefix, message, args, kwargs):
if args:
message = message % args
prefix = "%s" % (prefix,)
+ time = str(QtCore.QTime.currentTime().toString())
message = "%s" % (message,)
if isinstance(prefix, unicode):
prefix = prefix.encode("utf-8", "replace")
if isinstance(message, unicode):
message = message.encode("utf-8", "replace")
- self.entries.append((prefix, message))
+ self.entries.append((prefix, time, message))
for func in self.receivers:
try:
- func(prefix, message)
+ func(prefix, time, message)
except Exception, e:
import traceback
traceback.print_exc()
8 picard/ui/logview.py
View
@@ -38,13 +38,13 @@ def __init__(self, parent=None):
self.browser.setDocument(self.doc)
vbox = QtGui.QHBoxLayout(self)
vbox.addWidget(self.browser)
- for prefix, msg in log.entries:
- self.add_entry(prefix, msg)
+ for prefix, time, msg in log.entries:
+ self.add_entry(prefix, time, msg)
log.add_receiver(self.add_entry)
- def add_entry(self, prefix, msg):
+ def add_entry(self, prefix, time, msg):
self.textCursor.movePosition(QtGui.QTextCursor.End)
- self.textCursor.insertText(prefix + ' ' + str(QtCore.QThread.currentThreadId()) + ' ' + QtCore.QTime.currentTime().toString() + ' ' + msg, self.textFormat)
+ self.textCursor.insertText(prefix + ' ' + str(QtCore.QThread.currentThreadId()) + ' ' + time + ' ' + msg, self.textFormat)
self.textCursor.insertBlock()
sb = self.browser.verticalScrollBar()
sb.setValue(sb.maximum())
Please sign in to comment.
Something went wrong with that request. Please try again.