mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 04:23:56 +01:00
timestamps and appending for import log (#155)
This commit is contained in:
parent
2dbfbc8923
commit
1a86efc39f
2 changed files with 8 additions and 1 deletions
4
NEWS
4
NEWS
|
|
@ -2,6 +2,10 @@
|
|||
-----
|
||||
* Prompts in the importer interface are now colorized for easy
|
||||
reading. The default option is always highlighted.
|
||||
* The import logger has been improved for "always-on" use. First,
|
||||
it is now possible to specify a log file in .beetsconfig. Also,
|
||||
logs are now appended rather than overwritten and contain
|
||||
timestamps.
|
||||
* Fix crash when autotagging files with no metadata.
|
||||
|
||||
1.0b8
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ from __future__ import with_statement # Python 2.5
|
|||
import logging
|
||||
import sys
|
||||
import os
|
||||
import time
|
||||
|
||||
from beets import ui
|
||||
from beets.ui import print_
|
||||
|
|
@ -426,7 +427,8 @@ def import_files(lib, paths, copy, write, autot, logpath, art, threaded,
|
|||
# Open the log.
|
||||
if logpath:
|
||||
logpath = normpath(logpath)
|
||||
logfile = open(syspath(logpath), 'w')
|
||||
logfile = open(syspath(logpath), 'a')
|
||||
print >>logfile, 'import started', time.asctime()
|
||||
else:
|
||||
logfile = None
|
||||
|
||||
|
|
@ -458,6 +460,7 @@ def import_files(lib, paths, copy, write, autot, logpath, art, threaded,
|
|||
|
||||
# If we were logging, close the file.
|
||||
if logfile:
|
||||
print >>logfile, ''
|
||||
logfile.close()
|
||||
|
||||
# Emit event.
|
||||
|
|
|
|||
Loading…
Reference in a new issue