mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-10 01:21:00 +00:00
fix fileoutput flag
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@1877 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
494dbb61b0
commit
97b8972bd8
1 changed files with 7 additions and 1 deletions
|
|
@ -17,6 +17,8 @@
|
|||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
import sys
|
||||
import os
|
||||
import os.path
|
||||
|
||||
# dummy translator
|
||||
_ = lambda x: x
|
||||
|
|
@ -61,7 +63,11 @@ class Logger (object):
|
|||
|
||||
def init_fileoutput (self, args):
|
||||
"""initialize self.fd file descriptor from args"""
|
||||
if args.has_key('fileoutput'):
|
||||
if args.get('fileoutput'):
|
||||
fname = args['filename']
|
||||
path = os.path.dirname(fname)
|
||||
if path and not os.path.isdir(path):
|
||||
os.makedirs(path)
|
||||
self.fd = file(args['filename'], "w")
|
||||
self.close_fd = True
|
||||
elif args.has_key('fd'):
|
||||
|
|
|
|||
Loading…
Reference in a new issue