aboutsummaryrefslogtreecommitdiffstats
path: root/becommands/new.py
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2009-07-13 11:45:40 -0400
committerChris Ball <cjb@laptop.org>2009-07-13 11:45:40 -0400
commit5e249abfee7273c79640c4211607a6b4bf7b374c (patch)
treed588c5c801e142b59af53b9f9c15e3f9e1982737 /becommands/new.py
parent64f62aa2bb841c483e8cb2b663434b3ad3038f4c (diff)
parent17adbfb1c04684b986bf2c97cc4fa5197198aadc (diff)
downloadbugseverywhere-5e249abfee7273c79640c4211607a6b4bf7b374c.tar.gz
Large merge from W. Trevor King. Highlights:
be show --only-raw-body be-mbox-to-xml be-xml-to-mbox be comment --xml be --dir
Diffstat (limited to 'becommands/new.py')
-rw-r--r--becommands/new.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/becommands/new.py b/becommands/new.py
index 32e070a..ceb4949 100644
--- a/becommands/new.py
+++ b/becommands/new.py
@@ -1,6 +1,5 @@
# Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc.
# W. Trevor King <wking@drexel.edu>
-# <abentley@panoramicfeedback.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Create a new bug"""
-from libbe import cmdutil, bugdir, settings_object
+from libbe import cmdutil, bugdir
__desc__ = __doc__
def execute(args, test=False):
@@ -36,7 +35,7 @@ def execute(args, test=False):
True
>>> print bug.severity
minor
- >>> bug.target == settings_object.EMPTY
+ >>> bug.target == None
True
"""
parser = get_parser()
@@ -45,14 +44,18 @@ def execute(args, test=False):
if len(args) != 1:
raise cmdutil.UsageError("Please supply a summary message")
bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test)
- bug = bd.new_bug(summary=args[0])
+ if args[0] == '-': # read summary from stdin
+ summary = sys.stdin.readline()
+ else:
+ summary = args[0]
+ bug = bd.new_bug(summary=summary.strip())
if options.reporter != None:
bug.reporter = options.reporter
else:
bug.reporter = bug.creator
if options.assigned != None:
bug.assigned = options.assigned
- elif bd.default_assignee != settings_object.EMPTY:
+ elif bd.default_assignee != None:
bug.assigned = bd.default_assignee
bd.save()
print "Created bug with ID %s" % bd.bug_shortname(bug)
@@ -66,8 +69,9 @@ def get_parser():
return parser
longhelp="""
-Create a new bug, with a new ID. The summary specified on the commandline
-is a string that describes the bug briefly.
+Create a new bug, with a new ID. The summary specified on the
+commandline is a string (only one line) that describes the bug briefly
+or "-", in which case the string will be read from stdin.
"""
def help():