be --dir DIR COMMAND now roots the bugdir in DIR without changing directories.
[be.git] / becommands / severity.py
index 660586e1e2092a9b89e28baf77213e0e216f76d4..804dc4eafd896bb04cf1069664f9fd17cb8aa964 100644 (file)
@@ -1,4 +1,5 @@
 # Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc.
+#                         Gianluca Montecchi <gian@grys.it>
 #                         Marien Zwart <marienz@gentoo.org>
 #                         Thomas Gerigk <tgerigk@gmx.de>
 #                         W. Trevor King <wking@drexel.edu>
@@ -20,7 +21,8 @@
 from libbe import cmdutil, bugdir, bug
 __desc__ = __doc__
 
-def execute(args, manipulate_encodings=True):
+def execute(args, manipulate_encodings=True, restrict_file_access=False,
+            dir="."):
     """
     >>> import os
     >>> bd = bugdir.SimpleBugDir()
@@ -41,8 +43,9 @@ def execute(args, manipulate_encodings=True):
     if len(args) not in (1,2):
         raise cmdutil.UsageError
     bd = bugdir.BugDir(from_disk=True,
-                       manipulate_encodings=manipulate_encodings)
-    bug = cmdutil.bug_from_shortname(bd, args[0])
+                       manipulate_encodings=manipulate_encodings,
+                       root=dir)
+    bug = cmdutil.bug_from_id(bd, args[0])
     if len(args) == 1:
         print bug.severity
     elif len(args) == 2: