Esempio n. 1
0
    def InitializeRoot(self):
        self.tree = Tree(self, multiple=True)
        self.root = self.tree.root

        import ContentTypeHandler
        icons = {
            Record.Record: IconImages.getRecordBitmap(),
            Record.Page: IconImages.getPageBitmap(),
            Record.Hit: IconImages.getHitBitmap(),
            ContentTypeHandler.DefaultContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.AMFContentType: IconImages.getFlexBitmap(),
            ContentTypeHandler.HTMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.XMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.PythonContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.BinContentType: IconImages.getWebBitmap(),
        }
        self.tree.SetIcons(icons)

        def GetType(data):
            if isinstance(data, Record.Hit):
                # TODO: this check is for compatibility, remove it in future
                if isinstance(data.req_handler,
                              ContentTypeHandler.ContentType):
                    return data.req_handler.__class__
                else:
                    # You see, really dirty trick,  so remove it in future...
                    if 'AMF' in str(data.req_handler.coder):
                        return ContentTypeHandler.AMFContentType
                    else:
                        return data.__class__
            else:
                return data.__class__

        self.tree.GetType = GetType
Esempio n. 2
0
    def InitializeRoot(self):
        self.tree = Tree(self, multiple=True)
        self.root = self.tree.root

        import ContentTypeHandler

        icons = {
            Record.Record: IconImages.getRecordBitmap(),
            Record.Page: IconImages.getPageBitmap(),
            Record.Hit: IconImages.getHitBitmap(),
            ContentTypeHandler.DefaultContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.AMFContentType: IconImages.getFlexBitmap(),
            ContentTypeHandler.HTMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.XMLContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.PythonContentType: IconImages.getWebBitmap(),
            ContentTypeHandler.BinContentType: IconImages.getWebBitmap(),
        }
        self.tree.SetIcons(icons)

        def GetType(data):
            if isinstance(data, Record.Hit):
                # TODO: this check is for compatibility, remove it in future
                if isinstance(data.req_handler, ContentTypeHandler.ContentType):
                    return data.req_handler.__class__
                else:
                    # You see, really dirty trick,  so remove it in future...
                    if "AMF" in str(data.req_handler.coder):
                        return ContentTypeHandler.AMFContentType
                    else:
                        return data.__class__
            else:
                return data.__class__

        self.tree.GetType = GetType
Esempio n. 3
0
	def InitTree(self):
		self.tree = Tree(self, multiple = True)
		self.root = self.tree.root

		# FIXME: duplicated code in RecordPanel.py
		import ContentTypeHandler
		icons = {
				Special       : (IconImages.getSpecialOffBitmap(),
								 IconImages.getSpecialBitmap()),

				Record.Record : IconImages.getRecordBitmap(),
				Record.Page   : IconImages.getPageBitmap(),
				Record.Hit    : IconImages.getHitBitmap(),

				Controller.Script: IconImages.getPythonBitmap(),
				Controller.If    : IconImages.getIfBitmap(),
				Controller.Loop  : IconImages.getLoopBitmap(),
				Controller.Block : IconImages.getBlockBitmap(),

				ContentTypeHandler.DefaultContentType : IconImages.getWebBitmap(),
				ContentTypeHandler.AMFContentType     : IconImages.getFlexBitmap(),
				ContentTypeHandler.HTMLContentType    : IconImages.getWebBitmap(),
				ContentTypeHandler.XMLContentType     : IconImages.getXMLBitmap(),
				ContentTypeHandler.PythonContentType  : IconImages.getPythonBitmap(),
				ContentTypeHandler.BinContentType     : IconImages.getBinaryBitmap(),
				}
		self.tree.SetIcons(icons)

		def GetType(data):
			if isinstance(data, Record.Hit):
				# TODO: this check is for compatibility, remove it in future
				if isinstance(data.req_handler, ContentTypeHandler.ContentType):
					return data.req_handler.__class__
				else:
					# You see, really dirty trick,  so remove it in future...
					if 'AMF' in str(data.req_handler.coder):
						return ContentTypeHandler.AMFContentType
					else:
						return data.__class__
			else:
				return data.__class__

		self.tree.GetType = GetType