Fixed bug handing missing $EDITOR
authorAaron Bentley <abentley@panoramicfeedback.com>
Tue, 17 May 2005 13:29:15 +0000 (13:29 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Tue, 17 May 2005 13:29:15 +0000 (13:29 +0000)
.be/bugs/7bfc591e-584a-476e-8e11-b548f1afcaa6/values [new file with mode: 0644]
.be/bugs/ecc91b94-7f3f-44a7-af58-03191d327a7f/values [new file with mode: 0644]
becommands/comment.py
libbe/utility.py

diff --git a/.be/bugs/7bfc591e-584a-476e-8e11-b548f1afcaa6/values b/.be/bugs/7bfc591e-584a-476e-8e11-b548f1afcaa6/values
new file mode 100644 (file)
index 0000000..974ca50
--- /dev/null
@@ -0,0 +1,35 @@
+
+
+
+creator=abentley
+
+
+
+
+
+
+severity=minor
+
+
+
+
+
+
+status=open
+
+
+
+
+
+
+summary=no tests for --help, -h, help, etc.
+
+
+
+
+
+
+time=Tue, 17 May 2005 13:27:18 +0000
+
+
+
diff --git a/.be/bugs/ecc91b94-7f3f-44a7-af58-03191d327a7f/values b/.be/bugs/ecc91b94-7f3f-44a7-af58-03191d327a7f/values
new file mode 100644 (file)
index 0000000..6faca58
--- /dev/null
@@ -0,0 +1,35 @@
+
+
+
+creator=abentley
+
+
+
+
+
+
+severity=minor
+
+
+
+
+
+
+status=open
+
+
+
+
+
+
+summary=no tests for missing 
+
+
+
+
+
+
+time=Tue, 17 May 2005 13:27:33 +0000
+
+
+
index 0207a6cd1ad104b8676f56e422528ba79b353047..6a7998c5daaba5d37190bd5cbc7fd974d387db18 100644 (file)
@@ -44,7 +44,11 @@ def execute(args):
         raise cmdutil.UsageError()
     bug = cmdutil.get_bug(args[0])
     if len(args) == 1:
-        body = utility.editor_string()
+        try:
+            body = utility.editor_string()
+        except utility.CantFindEditor:
+            raise cmdutil.UserError(
+                "No comment supplied, and EDITOR not specified.")
         if body is None:
             raise cmdutil.UserError("No comment entered.")
     else:
index 5a5cb40b204a00946cf47763ae6fc24055df7b8e..a31d5d8e502c68cb8ce4d1f4d8f8935eae7c1e0e 100644 (file)
@@ -94,14 +94,16 @@ def str_to_time(str_time):
 def handy_time(time_val):
     return time.strftime("%a, %d %b %Y %H:%M", time.localtime(time_val))
 
+class CantFindEditor(Exception):
+    def __init__(self):
+        Exception.__init__(self, "Can't find editor to get string from")
+
 def editor_string():
     """Invokes the editor, and returns the user_produced text as a string"""
     try:
         editor = os.environ["EDITOR"]
     except KeyError:
-        raise cmdutil.UserError(
-            "No comment supplied, and EDITOR not specified.")
-
+        raise CantFindEditor()
     fhandle, fname = tempfile.mkstemp()
     try:
         os.close(fhandle)