import buried_point

class InformationCollector:
    PrintTestPage = 'PrintTestPage'
    DeletePrinter = 'DeletePrinter'
    SetDefaultPrinter = 'SetDefaultPrinter'
    CopyPrinter = 'CopyPrinter'
    RenamePrinter = 'RenamePrinter'
    AddPrinterGroup = 'AddPrinterGroup'
    DeletePrinterGroup = 'DeletePrinterGroup'
    CopyPrinterGroup = 'CopyPrinterGroup'
    RenamePrinterGroup = 'RenamePrinterGroup'
    ModifyPrinterGroup = 'ModifyPrinterGroup'
    PrinterGroupProperty = 'PrinterGroupProperty'
    ConnectToRemoteCupsServer = 'ConnectToRemoteCupsServer'
    PublishSharedPrintersConnectedToThisSystem = 'PublishSharedPrintersConnectedToThisSystem'
    AllowPrintingFromTheInternet = 'AllowPrintingFromTheInternet'
    AllowRemoteAdministration = 'AllowRemoteAdministration'
    AllowUsersToCancelAnyJob = 'AllowUsersToCancelAnyJob'
    ServerDebugLogging = 'ServerDebugLogging'
    JobHistorySetting = 'JobHistorySetting'
    AcceptingJobs = 'AcceptingJobs'
    ErrorPolicy = 'ErrorPolicy'
    OperationPolicy = 'OperationPolicy'
    StartingBanner = 'StartingBanner'
    EndingBanner = 'EndingBanner'
    AccessControl = 'AccessControl'
    JobAuthenticate = 'JobAuthenticate'
    JobAttributes = 'JobAttributes'
    JobRetrieve = 'JobRetrieve'
    TaskBarClick = 'TaskBarClick'
    PermissionChanged = 'PermissionChanged'
    Troubleshoot = 'Troubleshoot'

    def addPoint(self, str):
        self._sendMessage("point", str)

    def addMessage(self, str):
        self._sendMessage("message", str)

    def addMessageMap(self, messageType, data):
        self._sendMessageMap(messageType, data)

    def _sendMessageMap(self, messageType, data):
        buried_point.buried_point('system-config-printer', messageType, data, len(data))

    def _sendMessage(self, key, value):
        data={key: value}
        buried_point.buried_point('system-config-printer', 'FunctionType', data, 1)


if __name__ == '__main__':
    messageMap={}
    messageMap['printername'] = 'name'
    messageMap['ppdname'] = 'ppd'
    messageMap['printeruri'] = 'uri'
    messageMap['printerinfo'] = 'info'
    InformationCollector().addMessageMap('addPrinter', messageMap)