add command 'logtime'
This commit is contained in:
parent
b9bba5924a
commit
f951f51b3d
1 changed files with 24 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
# along with weboob. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
from datetime import timedelta
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from weboob.capabilities.bugtracker import ICapBugTracker, Query, Update
|
from weboob.capabilities.bugtracker import ICapBugTracker, Query, Update
|
||||||
|
|
@ -181,6 +182,29 @@ class BoobTracker(ReplApplication):
|
||||||
|
|
||||||
self.do('update_issue', id, update, backends=backend_name).wait()
|
self.do('update_issue', id, update, backends=backend_name).wait()
|
||||||
|
|
||||||
|
def do_logtime(self, line):
|
||||||
|
"""
|
||||||
|
logtime ISSUE HOURS [TEXT]
|
||||||
|
|
||||||
|
Log spent time on an issue.
|
||||||
|
"""
|
||||||
|
id, hours, text = self.parse_command_args(line, 3, 2)
|
||||||
|
if text is None:
|
||||||
|
text = self.acquire_input()
|
||||||
|
|
||||||
|
try:
|
||||||
|
hours = float(hours)
|
||||||
|
except ValueError:
|
||||||
|
print >>sys.stderr, 'Error: HOURS parameter may be a float'
|
||||||
|
return 1
|
||||||
|
|
||||||
|
id, backend_name = self.parse_id(id, unique_backend=True)
|
||||||
|
update = Update(0)
|
||||||
|
update.message = text
|
||||||
|
update.hours = timedelta(hours=hours)
|
||||||
|
|
||||||
|
self.do('update_issue', id, update, backends=backend_name).wait()
|
||||||
|
|
||||||
def complete_remove(self, text, line, *ignored):
|
def complete_remove(self, text, line, *ignored):
|
||||||
args = line.split(' ')
|
args = line.split(' ')
|
||||||
if len(args) == 2:
|
if len(args) == 2:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue