зеркало из https://github.com/microsoft/clang-1.git
Add "SelectionParameter" class to represent drop-down boxes.
Added "Classification" field to Radar filing. Modified FileRadar.scpt to take the classification as an argument. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
7000bf8f87
Коммит
fe6fa074db
|
@ -37,23 +37,33 @@ from email.mime.text import MIMEText
|
||||||
class ReporterParameter:
|
class ReporterParameter:
|
||||||
def __init__(self, n):
|
def __init__(self, n):
|
||||||
self.name = n
|
self.name = n
|
||||||
|
|
||||||
def getName(self):
|
def getName(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
def getValue(self,r,bugtype,getConfigOption):
|
||||||
|
return getConfigOption(r.getName(),self.getName())
|
||||||
def saveConfigValue(self):
|
def saveConfigValue(self):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
class TextParameter (ReporterParameter):
|
class TextParameter (ReporterParameter):
|
||||||
def getValue(self,r,bugtype,getConfigOption):
|
def getHTML(self,r,bugtype,getConfigOption):
|
||||||
return getConfigOption(r.getName(),self.getName())
|
return """\
|
||||||
|
<tr>
|
||||||
|
<td class="form_clabel">%s:</td>
|
||||||
|
<td class="form_value"><input type="text" name="%s_%s" value="%s"></td>
|
||||||
|
</tr>"""%(self.getName(),r.getName(),self.getName(),self.getValue(r,bugtype,getConfigOption))
|
||||||
|
|
||||||
|
class SelectionParameter (ReporterParameter):
|
||||||
|
def __init__(self, n, values):
|
||||||
|
ReporterParameter.__init__(self,n)
|
||||||
|
self.values = values
|
||||||
|
|
||||||
def getHTML(self,r,bugtype,getConfigOption):
|
def getHTML(self,r,bugtype,getConfigOption):
|
||||||
return """\
|
return """\
|
||||||
<tr>
|
<tr>
|
||||||
<td class="form_clabel">%s:</td>
|
<td class="form_clabel">%s:</td><td class="form_value"><select name="%s_%s">
|
||||||
<td class="form_value"><input type="text" name="%s_%s" value="%s"></td>
|
%s
|
||||||
</tr>"""%(self.getName(),r.getName(),self.getName(),self.getValue(r,bugtype,getConfigOption))
|
</select></td>"""%(self.getName(),r.getName(),self.getName(),'\n'.join(["""\
|
||||||
|
<option value="%s">%s</option>"""%(o[0],o[1]) for o in self.values]))
|
||||||
|
|
||||||
#===------------------------------------------------------------------------===#
|
#===------------------------------------------------------------------------===#
|
||||||
# Reporters
|
# Reporters
|
||||||
|
@ -156,11 +166,16 @@ class RadarReporter:
|
||||||
return 'Radar'
|
return 'Radar'
|
||||||
|
|
||||||
def getParameters(self):
|
def getParameters(self):
|
||||||
return map(lambda x:TextParameter(x),['Component', 'Component Version'])
|
return [ TextParameter('Component'), TextParameter('Component Version'),
|
||||||
|
SelectionParameter('Classification',
|
||||||
|
[ ['1', 'Security'], ['2', 'Crash/Hang/Data Loss'],
|
||||||
|
['3', 'Performance'], ['4', 'UI/Usability'],
|
||||||
|
['6', 'Serious Bug'], ['7', 'Other'] ]) ]
|
||||||
|
|
||||||
def fileReport(self, report, parameters):
|
def fileReport(self, report, parameters):
|
||||||
component = parameters.get('Component', '')
|
component = parameters.get('Component', '')
|
||||||
componentVersion = parameters.get('Component Version', '')
|
componentVersion = parameters.get('Component Version', '')
|
||||||
|
classification = parameters.get('Classification', '')
|
||||||
personID = ""
|
personID = ""
|
||||||
diagnosis = ""
|
diagnosis = ""
|
||||||
config = ""
|
config = ""
|
||||||
|
@ -171,12 +186,11 @@ class RadarReporter:
|
||||||
componentVersion = 'X'
|
componentVersion = 'X'
|
||||||
|
|
||||||
script = os.path.join(os.path.dirname(__file__),'Resources/FileRadar.scpt')
|
script = os.path.join(os.path.dirname(__file__),'Resources/FileRadar.scpt')
|
||||||
args = ['osascript', script, component, componentVersion, personID, report.title,
|
args = ['osascript', script, component, componentVersion, classification, personID, report.title,
|
||||||
report.description, diagnosis, config] + map(os.path.abspath, report.files)
|
report.description, diagnosis, config] + map(os.path.abspath, report.files)
|
||||||
# print >>sys.stderr, args
|
# print >>sys.stderr, args
|
||||||
try:
|
try:
|
||||||
p = subprocess.Popen(args,
|
p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
||||||
except:
|
except:
|
||||||
raise ReportFailure("Unable to file radar (AppleScript failure).")
|
raise ReportFailure("Unable to file radar (AppleScript failure).")
|
||||||
data, err = p.communicate()
|
data, err = p.communicate()
|
||||||
|
|
Двоичные данные
tools/scan-view/Resources/FileRadar.scpt
Двоичные данные
tools/scan-view/Resources/FileRadar.scpt
Двоичный файл не отображается.
Загрузка…
Ссылка в новой задаче