Ignore:
Timestamp:
04/06/13 14:06:45 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
xplane
Parents:
478:00d38a068da9 (diff), 495:9c830f5791a5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merged the default branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/web.py

    r450 r496  
    1313import traceback
    1414import xml.sax
     15import xmlrpclib
    1516
    1617#---------------------------------------------------------------------------------------
     
    794795#------------------------------------------------------------------------------
    795796
     797class SendBugReport(Request):
     798    """A request to send a bug report to the project homepage."""
     799    _latin2Encoder = codecs.getencoder("iso-8859-2")
     800
     801    def __init__(self, callback, summary, description, email):
     802        """Construct the request for the given bug report."""
     803        super(SendBugReport, self).__init__(callback)
     804        self._summary = summary
     805        self._description = description
     806        self._email = email
     807
     808    def run(self):
     809        """Perform the sending of the bug report."""
     810        serverProxy = xmlrpclib.ServerProxy("http://mlx.varadiistvan.hu/rpc")
     811
     812        result = Result()
     813        result.success = False
     814
     815        attributes = {}
     816        if self._email:
     817            attributes["reporter"] = self._email
     818
     819        result.ticketID = serverProxy.ticket.create(self._summary, self._description,
     820                                                    attributes, True)
     821        print "Created ticket with ID:", result.ticketID
     822        result.success = True
     823
     824        return result
     825
     826#------------------------------------------------------------------------------
     827
    796828class Handler(threading.Thread):
    797829    """The handler for the web services.
     
    835867        """Send the given ACARS"""
    836868        self._addRequest(SendACARS(callback, acars))
     869
     870    def sendBugReport(self, callback, summary, description, email):
     871        """Send a bug report with the given data."""
     872        self._addRequest(SendBugReport(callback, summary, description, email))
    837873
    838874    def run(self):
Note: See TracChangeset for help on using the changeset viewer.