blob: 089c5cf52c24afd6258c6a3886426e3ac6adac4e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# -*- coding: utf-8 -*-
import sys, os
from git_taskrepo.command import Command
from git_taskrepo.taskrepo import update_taskrepo, parse_testinfo, TRX
class Update(Command):
"""Update Taskrepo for <TASK>"""
enabled = True
def options(self):
self.parser.usage = "%%prog %s [<path/to/task>]" % self.normalized_name
def run(self, *args, **kwargs):
self.set_repo(**kwargs)
self.set_taskrepo(**kwargs)
if len(args) >= 1:
taskpath = os.path.normpath(os.path.join(os.getcwd(), args[0]))
else:
taskpath = os.getcwd()
sys.stderr.write("[TaskRepo] Updating %s ... " % taskpath)
try:
update_taskrepo(self.repo, self.taskrepo, taskpath)
except TRX, e:
sys.stderr.write("FAIL (%s).\n" % e)
sys.exit(1)
else:
sys.stderr.write("done.\n")
|