From 4c6a1e6439293c7e584aef4fda0da1a3968fe7c9 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 19 Nov 2009 17:00:02 -0500 Subject: Ran the new update_copyright.py --- becommands/new.py | 1 + 1 file changed, 1 insertion(+) (limited to 'becommands/new.py') diff --git a/becommands/new.py b/becommands/new.py index a8ee2ec..30a7d28 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -1,4 +1,5 @@ # Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc. +# Gianluca Montecchi # W. Trevor King # # This program is free software; you can redistribute it and/or modify -- cgit From 614d4e40e148520ac511cbe0606bcbdcf24c8a08 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 21 Nov 2009 15:18:02 -0500 Subject: Added restrict_file_access to becommands' execute() args. + associated adjustments in other files. See cmdutil.restrict_file_access.__doc__ for an explanation of the security hole this closes. --- becommands/new.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'becommands/new.py') diff --git a/becommands/new.py b/becommands/new.py index 30a7d28..92d61e4 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -20,7 +20,7 @@ from libbe import cmdutil, bugdir import sys __desc__ = __doc__ -def execute(args, manipulate_encodings=True): +def execute(args, manipulate_encodings=True, restrict_file_access=False): """ >>> import os, time >>> from libbe import bug -- cgit From 1f852b56004d50fd7412788a0ae208907acc1120 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 5 Dec 2009 20:57:31 -0500 Subject: Remove Bug.target references from several becommands (all but target.py). --- becommands/new.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'becommands/new.py') diff --git a/becommands/new.py b/becommands/new.py index 92d61e4..00e8a47 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -37,8 +37,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): True >>> print bug.severity minor - >>> bug.target == None - True + >>> print bug.status + open >>> bd.cleanup() """ parser = get_parser() -- cgit From fdf9925ffaada614544d1b2d3ccecb42f1549acb Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 7 Dec 2009 07:18:48 -0500 Subject: be --dir DIR COMMAND now roots the bugdir in DIR without changing directories. Previously, for the directory structure A |-- X `-- Y You could do something like A$ be --dir X diff --dir ../Y Now it's A$ be --dir X diff --dir Y The --root option to `be init` has been removed as redundant. Replace calls like be init --root DIR with be --dir DIR init --- becommands/new.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'becommands/new.py') diff --git a/becommands/new.py b/becommands/new.py index 00e8a47..30f8834 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -20,7 +20,8 @@ from libbe import cmdutil, bugdir import sys __desc__ = __doc__ -def execute(args, manipulate_encodings=True, restrict_file_access=False): +def execute(args, manipulate_encodings=True, restrict_file_access=False, + dir="."): """ >>> import os, time >>> from libbe import bug @@ -47,7 +48,8 @@ def execute(args, manipulate_encodings=True, restrict_file_access=False): if len(args) != 1: raise cmdutil.UsageError("Please supply a summary message") bd = bugdir.BugDir(from_disk=True, - manipulate_encodings=manipulate_encodings) + manipulate_encodings=manipulate_encodings, + root=dir) if args[0] == '-': # read summary from stdin summary = sys.stdin.readline() else: -- cgit From 49a7771336ce09f6d42c7699ef32aecea0e83182 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 7 Dec 2009 20:07:55 -0500 Subject: Initial directory restructuring to clarify dependencies --- becommands/new.py | 83 ------------------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 becommands/new.py (limited to 'becommands/new.py') diff --git a/becommands/new.py b/becommands/new.py deleted file mode 100644 index 30f8834..0000000 --- a/becommands/new.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc. -# Gianluca Montecchi -# W. Trevor King -# -# 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 -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -"""Create a new bug""" -from libbe import cmdutil, bugdir -import sys -__desc__ = __doc__ - -def execute(args, manipulate_encodings=True, restrict_file_access=False, - dir="."): - """ - >>> import os, time - >>> from libbe import bug - >>> bd = bugdir.SimpleBugDir() - >>> os.chdir(bd.root) - >>> bug.uuid_gen = lambda: "X" - >>> execute (["this is a test",], manipulate_encodings=False) - Created bug with ID X - >>> bd._clear_bugs() - >>> bug = bd.bug_from_uuid("X") - >>> print bug.summary - this is a test - >>> bug.time <= int(time.time()) - True - >>> print bug.severity - minor - >>> print bug.status - open - >>> bd.cleanup() - """ - parser = get_parser() - options, args = parser.parse_args(args) - cmdutil.default_complete(options, args, parser) - if len(args) != 1: - raise cmdutil.UsageError("Please supply a summary message") - bd = bugdir.BugDir(from_disk=True, - manipulate_encodings=manipulate_encodings, - root=dir) - 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 != None: - bug.assigned = bd.default_assignee - print "Created bug with ID %s" % bd.bug_shortname(bug) - -def get_parser(): - parser = cmdutil.CmdOptionParser("be new SUMMARY") - parser.add_option("-r", "--reporter", metavar="REPORTER", dest="reporter", - help="The user who reported the bug", default=None) - parser.add_option("-a", "--assigned", metavar="ASSIGNED", dest="assigned", - help="The developer in charge of the bug", default=None) - return parser - -longhelp=""" -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(): - return get_parser().help_str() + longhelp -- cgit