How to use context_tag method in unittest-xml-reporting

Best Python code snippet using unittest-xml-reporting_python

glx.py

Source:glx.py Github

copy

Full Screen

1#2# This file generated automatically from glx.xml by py_client.py.3# Edit at your peril.4#5import xcb6import cStringIO7from struct import pack, unpack_from8from array import array9import xproto10MAJOR_VERSION = 111MINOR_VERSION = 412key = xcb.ExtensionKey('GLX')13class GenericError(xcb.Error):14 def __init__(self, parent, offset=0):15 xcb.Error.__init__(self, parent, offset)16 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)17class BadGeneric(xcb.ProtocolException):18 pass19class ContextError(xcb.Error):20 def __init__(self, parent, offset=0):21 xcb.Error.__init__(self, parent, offset)22 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)23class BadContext(xcb.ProtocolException):24 pass25class ContextStateError(xcb.Error):26 def __init__(self, parent, offset=0):27 xcb.Error.__init__(self, parent, offset)28 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)29class BadContextState(xcb.ProtocolException):30 pass31class DrawableError(xcb.Error):32 def __init__(self, parent, offset=0):33 xcb.Error.__init__(self, parent, offset)34 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)35class BadDrawable(xcb.ProtocolException):36 pass37class PixmapError(xcb.Error):38 def __init__(self, parent, offset=0):39 xcb.Error.__init__(self, parent, offset)40 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)41class BadPixmap(xcb.ProtocolException):42 pass43class ContextTagError(xcb.Error):44 def __init__(self, parent, offset=0):45 xcb.Error.__init__(self, parent, offset)46 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)47class BadContextTag(xcb.ProtocolException):48 pass49class CurrentWindowError(xcb.Error):50 def __init__(self, parent, offset=0):51 xcb.Error.__init__(self, parent, offset)52 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)53class BadCurrentWindow(xcb.ProtocolException):54 pass55class RenderRequestError(xcb.Error):56 def __init__(self, parent, offset=0):57 xcb.Error.__init__(self, parent, offset)58 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)59class BadRenderRequest(xcb.ProtocolException):60 pass61class LargeRequestError(xcb.Error):62 def __init__(self, parent, offset=0):63 xcb.Error.__init__(self, parent, offset)64 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)65class BadLargeRequest(xcb.ProtocolException):66 pass67class UnsupportedPrivateRequestError(xcb.Error):68 def __init__(self, parent, offset=0):69 xcb.Error.__init__(self, parent, offset)70 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)71class BadUnsupportedPrivateRequest(xcb.ProtocolException):72 pass73class FBConfigError(xcb.Error):74 def __init__(self, parent, offset=0):75 xcb.Error.__init__(self, parent, offset)76 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)77class BadFBConfig(xcb.ProtocolException):78 pass79class PbufferError(xcb.Error):80 def __init__(self, parent, offset=0):81 xcb.Error.__init__(self, parent, offset)82 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)83class BadPbuffer(xcb.ProtocolException):84 pass85class CurrentDrawableError(xcb.Error):86 def __init__(self, parent, offset=0):87 xcb.Error.__init__(self, parent, offset)88 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)89class BadCurrentDrawable(xcb.ProtocolException):90 pass91class WindowError(xcb.Error):92 def __init__(self, parent, offset=0):93 xcb.Error.__init__(self, parent, offset)94 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)95class BadWindow(xcb.ProtocolException):96 pass97class GLXBadProfileARBError(xcb.Error):98 def __init__(self, parent, offset=0):99 xcb.Error.__init__(self, parent, offset)100 (self.bad_value, self.minor_opcode, self.major_opcode,) = unpack_from('xx2xIHB21x', parent, offset)101class BadGLXBadProfileARB(xcb.ProtocolException):102 pass103class PbufferClobberEvent(xcb.Event):104 def __init__(self, parent, offset=0):105 xcb.Event.__init__(self, parent, offset)106 (self.event_type, self.draw_type, self.drawable, self.b_mask, self.aux_buffer, self.x, self.y, self.width, self.height, self.count,) = unpack_from('xx2xHHIIHHHHHH4x', parent, offset)107class BufferSwapCompleteEvent(xcb.Event):108 def __init__(self, parent, offset=0):109 xcb.Event.__init__(self, parent, offset)110 (self.event_type, self.drawable, self.ust_hi, self.ust_lo, self.msc_hi, self.msc_lo, self.sbc,) = unpack_from('xx2xH2xIIIIII', parent, offset)111class PBCET:112 Damaged = 32791113 Saved = 32792114class PBCDT:115 Window = 32793116 Pbuffer = 32794117class MakeCurrentCookie(xcb.Cookie):118 pass119class MakeCurrentReply(xcb.Reply):120 def __init__(self, parent, offset=0):121 xcb.Reply.__init__(self, parent, offset)122 (self.context_tag,) = unpack_from('xx2x4xI20x', parent, offset)123class IsDirectCookie(xcb.Cookie):124 pass125class IsDirectReply(xcb.Reply):126 def __init__(self, parent, offset=0):127 xcb.Reply.__init__(self, parent, offset)128 (self.is_direct,) = unpack_from('xx2x4xB23x', parent, offset)129class QueryVersionCookie(xcb.Cookie):130 pass131class QueryVersionReply(xcb.Reply):132 def __init__(self, parent, offset=0):133 xcb.Reply.__init__(self, parent, offset)134 (self.major_version, self.minor_version,) = unpack_from('xx2x4xII16x', parent, offset)135class GC:136 GL_CURRENT_BIT = 1137 GL_POINT_BIT = 2138 GL_LINE_BIT = 4139 GL_POLYGON_BIT = 8140 GL_POLYGON_STIPPLE_BIT = 16141 GL_PIXEL_MODE_BIT = 32142 GL_LIGHTING_BIT = 64143 GL_FOG_BIT = 128144 GL_DEPTH_BUFFER_BIT = 256145 GL_ACCUM_BUFFER_BIT = 512146 GL_STENCIL_BUFFER_BIT = 1024147 GL_VIEWPORT_BIT = 2048148 GL_TRANSFORM_BIT = 4096149 GL_ENABLE_BIT = 8192150 GL_COLOR_BUFFER_BIT = 16384151 GL_HINT_BIT = 32768152 GL_EVAL_BIT = 65536153 GL_LIST_BIT = 131072154 GL_TEXTURE_BIT = 262144155 GL_SCISSOR_BIT = 524288156 GL_ALL_ATTRIB_BITS = 16777215157class GetVisualConfigsCookie(xcb.Cookie):158 pass159class GetVisualConfigsReply(xcb.Reply):160 def __init__(self, parent, offset=0):161 xcb.Reply.__init__(self, parent, offset)162 (self.num_visuals, self.num_properties,) = unpack_from('xx2x4xII16x', parent, offset)163 offset += 32164 self.property_list = xcb.List(parent, offset, self.length, 'I', 4)165class VendorPrivateWithReplyCookie(xcb.Cookie):166 pass167class VendorPrivateWithReplyReply(xcb.Reply):168 def __init__(self, parent, offset=0):169 xcb.Reply.__init__(self, parent, offset)170 (self.retval,) = unpack_from('xx2x4xI', parent, offset)171 offset += 12172 self.data1 = xcb.List(parent, offset, 24, 'B', 1)173 offset += len(self.data1.buf())174 offset += xcb.type_pad(1, offset)175 self.data2 = xcb.List(parent, offset, (self.length * 4), 'B', 1)176class QueryExtensionsStringCookie(xcb.Cookie):177 pass178class QueryExtensionsStringReply(xcb.Reply):179 def __init__(self, parent, offset=0):180 xcb.Reply.__init__(self, parent, offset)181 (self.n,) = unpack_from('xx2x4x4xI16x', parent, offset)182class QueryServerStringCookie(xcb.Cookie):183 pass184class QueryServerStringReply(xcb.Reply):185 def __init__(self, parent, offset=0):186 xcb.Reply.__init__(self, parent, offset)187 (self.str_len,) = unpack_from('xx2x4x4xI16x', parent, offset)188 offset += 32189 self.string = xcb.List(parent, offset, self.str_len, 'b', 1)190class GetFBConfigsCookie(xcb.Cookie):191 pass192class GetFBConfigsReply(xcb.Reply):193 def __init__(self, parent, offset=0):194 xcb.Reply.__init__(self, parent, offset)195 (self.num_FB_configs, self.num_properties,) = unpack_from('xx2x4xII16x', parent, offset)196 offset += 32197 self.property_list = xcb.List(parent, offset, self.length, 'I', 4)198class QueryContextCookie(xcb.Cookie):199 pass200class QueryContextReply(xcb.Reply):201 def __init__(self, parent, offset=0):202 xcb.Reply.__init__(self, parent, offset)203 (self.num_attribs,) = unpack_from('xx2x4xI20x', parent, offset)204 offset += 32205 self.attribs = xcb.List(parent, offset, (self.num_attribs * 2), 'I', 4)206class MakeContextCurrentCookie(xcb.Cookie):207 pass208class MakeContextCurrentReply(xcb.Reply):209 def __init__(self, parent, offset=0):210 xcb.Reply.__init__(self, parent, offset)211 (self.context_tag,) = unpack_from('xx2x4xI20x', parent, offset)212class GetDrawableAttributesCookie(xcb.Cookie):213 pass214class GetDrawableAttributesReply(xcb.Reply):215 def __init__(self, parent, offset=0):216 xcb.Reply.__init__(self, parent, offset)217 (self.num_attribs,) = unpack_from('xx2x4xI20x', parent, offset)218 offset += 32219 self.attribs = xcb.List(parent, offset, (self.num_attribs * 2), 'I', 4)220class GenListsCookie(xcb.Cookie):221 pass222class GenListsReply(xcb.Reply):223 def __init__(self, parent, offset=0):224 xcb.Reply.__init__(self, parent, offset)225 (self.ret_val,) = unpack_from('xx2x4xI', parent, offset)226class RenderModeCookie(xcb.Cookie):227 pass228class RenderModeReply(xcb.Reply):229 def __init__(self, parent, offset=0):230 xcb.Reply.__init__(self, parent, offset)231 (self.ret_val, self.n, self.new_mode,) = unpack_from('xx2x4xIII12x', parent, offset)232 offset += 32233 self.data = xcb.List(parent, offset, self.n, 'I', 4)234class RM:235 GL_RENDER = 7168236 GL_FEEDBACK = 7169237 GL_SELECT = 7170238class FinishCookie(xcb.Cookie):239 pass240class FinishReply(xcb.Reply):241 def __init__(self, parent, offset=0):242 xcb.Reply.__init__(self, parent, offset)243class ReadPixelsCookie(xcb.Cookie):244 pass245class ReadPixelsReply(xcb.Reply):246 def __init__(self, parent, offset=0):247 xcb.Reply.__init__(self, parent, offset)248 offset += 32249 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)250class GetBooleanvCookie(xcb.Cookie):251 pass252class GetBooleanvReply(xcb.Reply):253 def __init__(self, parent, offset=0):254 xcb.Reply.__init__(self, parent, offset)255 (self.n, self.datum,) = unpack_from('xx2x4x4xIB15x', parent, offset)256 offset += 32257 self.data = xcb.List(parent, offset, self.n, 'B', 1)258class GetClipPlaneCookie(xcb.Cookie):259 pass260class GetClipPlaneReply(xcb.Reply):261 def __init__(self, parent, offset=0):262 xcb.Reply.__init__(self, parent, offset)263 offset += 32264 self.data = xcb.List(parent, offset, (self.length / 2), 'd', 8)265class GetDoublevCookie(xcb.Cookie):266 pass267class GetDoublevReply(xcb.Reply):268 def __init__(self, parent, offset=0):269 xcb.Reply.__init__(self, parent, offset)270 (self.n, self.datum,) = unpack_from('xx2x4x4xId8x', parent, offset)271 offset += 32272 self.data = xcb.List(parent, offset, self.n, 'd', 8)273class GetErrorCookie(xcb.Cookie):274 pass275class GetErrorReply(xcb.Reply):276 def __init__(self, parent, offset=0):277 xcb.Reply.__init__(self, parent, offset)278 (self.error,) = unpack_from('xx2x4xi', parent, offset)279class GetFloatvCookie(xcb.Cookie):280 pass281class GetFloatvReply(xcb.Reply):282 def __init__(self, parent, offset=0):283 xcb.Reply.__init__(self, parent, offset)284 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)285 offset += 32286 self.data = xcb.List(parent, offset, self.n, 'f', 4)287class GetIntegervCookie(xcb.Cookie):288 pass289class GetIntegervReply(xcb.Reply):290 def __init__(self, parent, offset=0):291 xcb.Reply.__init__(self, parent, offset)292 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)293 offset += 32294 self.data = xcb.List(parent, offset, self.n, 'i', 4)295class GetLightfvCookie(xcb.Cookie):296 pass297class GetLightfvReply(xcb.Reply):298 def __init__(self, parent, offset=0):299 xcb.Reply.__init__(self, parent, offset)300 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)301 offset += 32302 self.data = xcb.List(parent, offset, self.n, 'f', 4)303class GetLightivCookie(xcb.Cookie):304 pass305class GetLightivReply(xcb.Reply):306 def __init__(self, parent, offset=0):307 xcb.Reply.__init__(self, parent, offset)308 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)309 offset += 32310 self.data = xcb.List(parent, offset, self.n, 'i', 4)311class GetMapdvCookie(xcb.Cookie):312 pass313class GetMapdvReply(xcb.Reply):314 def __init__(self, parent, offset=0):315 xcb.Reply.__init__(self, parent, offset)316 (self.n, self.datum,) = unpack_from('xx2x4x4xId8x', parent, offset)317 offset += 32318 self.data = xcb.List(parent, offset, self.n, 'd', 8)319class GetMapfvCookie(xcb.Cookie):320 pass321class GetMapfvReply(xcb.Reply):322 def __init__(self, parent, offset=0):323 xcb.Reply.__init__(self, parent, offset)324 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)325 offset += 32326 self.data = xcb.List(parent, offset, self.n, 'f', 4)327class GetMapivCookie(xcb.Cookie):328 pass329class GetMapivReply(xcb.Reply):330 def __init__(self, parent, offset=0):331 xcb.Reply.__init__(self, parent, offset)332 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)333 offset += 32334 self.data = xcb.List(parent, offset, self.n, 'i', 4)335class GetMaterialfvCookie(xcb.Cookie):336 pass337class GetMaterialfvReply(xcb.Reply):338 def __init__(self, parent, offset=0):339 xcb.Reply.__init__(self, parent, offset)340 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)341 offset += 32342 self.data = xcb.List(parent, offset, self.n, 'f', 4)343class GetMaterialivCookie(xcb.Cookie):344 pass345class GetMaterialivReply(xcb.Reply):346 def __init__(self, parent, offset=0):347 xcb.Reply.__init__(self, parent, offset)348 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)349 offset += 32350 self.data = xcb.List(parent, offset, self.n, 'i', 4)351class GetPixelMapfvCookie(xcb.Cookie):352 pass353class GetPixelMapfvReply(xcb.Reply):354 def __init__(self, parent, offset=0):355 xcb.Reply.__init__(self, parent, offset)356 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)357 offset += 32358 self.data = xcb.List(parent, offset, self.n, 'f', 4)359class GetPixelMapuivCookie(xcb.Cookie):360 pass361class GetPixelMapuivReply(xcb.Reply):362 def __init__(self, parent, offset=0):363 xcb.Reply.__init__(self, parent, offset)364 (self.n, self.datum,) = unpack_from('xx2x4x4xII12x', parent, offset)365 offset += 32366 self.data = xcb.List(parent, offset, self.n, 'I', 4)367class GetPixelMapusvCookie(xcb.Cookie):368 pass369class GetPixelMapusvReply(xcb.Reply):370 def __init__(self, parent, offset=0):371 xcb.Reply.__init__(self, parent, offset)372 (self.n, self.datum,) = unpack_from('xx2x4x4xIH16x', parent, offset)373 offset += 34374 self.data = xcb.List(parent, offset, self.n, 'H', 2)375class GetPolygonStippleCookie(xcb.Cookie):376 pass377class GetPolygonStippleReply(xcb.Reply):378 def __init__(self, parent, offset=0):379 xcb.Reply.__init__(self, parent, offset)380 offset += 32381 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)382class GetStringCookie(xcb.Cookie):383 pass384class GetStringReply(xcb.Reply):385 def __init__(self, parent, offset=0):386 xcb.Reply.__init__(self, parent, offset)387 (self.n,) = unpack_from('xx2x4x4xI16x', parent, offset)388 offset += 32389 self.string = xcb.List(parent, offset, self.n, 'b', 1)390class GetTexEnvfvCookie(xcb.Cookie):391 pass392class GetTexEnvfvReply(xcb.Reply):393 def __init__(self, parent, offset=0):394 xcb.Reply.__init__(self, parent, offset)395 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)396 offset += 32397 self.data = xcb.List(parent, offset, self.n, 'f', 4)398class GetTexEnvivCookie(xcb.Cookie):399 pass400class GetTexEnvivReply(xcb.Reply):401 def __init__(self, parent, offset=0):402 xcb.Reply.__init__(self, parent, offset)403 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)404 offset += 32405 self.data = xcb.List(parent, offset, self.n, 'i', 4)406class GetTexGendvCookie(xcb.Cookie):407 pass408class GetTexGendvReply(xcb.Reply):409 def __init__(self, parent, offset=0):410 xcb.Reply.__init__(self, parent, offset)411 (self.n, self.datum,) = unpack_from('xx2x4x4xId8x', parent, offset)412 offset += 32413 self.data = xcb.List(parent, offset, self.n, 'd', 8)414class GetTexGenfvCookie(xcb.Cookie):415 pass416class GetTexGenfvReply(xcb.Reply):417 def __init__(self, parent, offset=0):418 xcb.Reply.__init__(self, parent, offset)419 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)420 offset += 32421 self.data = xcb.List(parent, offset, self.n, 'f', 4)422class GetTexGenivCookie(xcb.Cookie):423 pass424class GetTexGenivReply(xcb.Reply):425 def __init__(self, parent, offset=0):426 xcb.Reply.__init__(self, parent, offset)427 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)428 offset += 32429 self.data = xcb.List(parent, offset, self.n, 'i', 4)430class GetTexImageCookie(xcb.Cookie):431 pass432class GetTexImageReply(xcb.Reply):433 def __init__(self, parent, offset=0):434 xcb.Reply.__init__(self, parent, offset)435 (self.width, self.height, self.depth,) = unpack_from('xx2x4x8xiii4x', parent, offset)436 offset += 32437 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)438class GetTexParameterfvCookie(xcb.Cookie):439 pass440class GetTexParameterfvReply(xcb.Reply):441 def __init__(self, parent, offset=0):442 xcb.Reply.__init__(self, parent, offset)443 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)444 offset += 32445 self.data = xcb.List(parent, offset, self.n, 'f', 4)446class GetTexParameterivCookie(xcb.Cookie):447 pass448class GetTexParameterivReply(xcb.Reply):449 def __init__(self, parent, offset=0):450 xcb.Reply.__init__(self, parent, offset)451 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)452 offset += 32453 self.data = xcb.List(parent, offset, self.n, 'i', 4)454class GetTexLevelParameterfvCookie(xcb.Cookie):455 pass456class GetTexLevelParameterfvReply(xcb.Reply):457 def __init__(self, parent, offset=0):458 xcb.Reply.__init__(self, parent, offset)459 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)460 offset += 32461 self.data = xcb.List(parent, offset, self.n, 'f', 4)462class GetTexLevelParameterivCookie(xcb.Cookie):463 pass464class GetTexLevelParameterivReply(xcb.Reply):465 def __init__(self, parent, offset=0):466 xcb.Reply.__init__(self, parent, offset)467 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)468 offset += 32469 self.data = xcb.List(parent, offset, self.n, 'i', 4)470class IsListCookie(xcb.Cookie):471 pass472class IsListReply(xcb.Reply):473 def __init__(self, parent, offset=0):474 xcb.Reply.__init__(self, parent, offset)475 (self.ret_val,) = unpack_from('xx2x4xI', parent, offset)476class AreTexturesResidentCookie(xcb.Cookie):477 pass478class AreTexturesResidentReply(xcb.Reply):479 def __init__(self, parent, offset=0):480 xcb.Reply.__init__(self, parent, offset)481 (self.ret_val,) = unpack_from('xx2x4xI20x', parent, offset)482 offset += 32483 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)484class GenTexturesCookie(xcb.Cookie):485 pass486class GenTexturesReply(xcb.Reply):487 def __init__(self, parent, offset=0):488 xcb.Reply.__init__(self, parent, offset)489 offset += 32490 self.data = xcb.List(parent, offset, self.length, 'I', 4)491class IsTextureCookie(xcb.Cookie):492 pass493class IsTextureReply(xcb.Reply):494 def __init__(self, parent, offset=0):495 xcb.Reply.__init__(self, parent, offset)496 (self.ret_val,) = unpack_from('xx2x4xI', parent, offset)497class GetColorTableCookie(xcb.Cookie):498 pass499class GetColorTableReply(xcb.Reply):500 def __init__(self, parent, offset=0):501 xcb.Reply.__init__(self, parent, offset)502 (self.width,) = unpack_from('xx2x4x8xi12x', parent, offset)503 offset += 32504 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)505class GetColorTableParameterfvCookie(xcb.Cookie):506 pass507class GetColorTableParameterfvReply(xcb.Reply):508 def __init__(self, parent, offset=0):509 xcb.Reply.__init__(self, parent, offset)510 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)511 offset += 32512 self.data = xcb.List(parent, offset, self.n, 'f', 4)513class GetColorTableParameterivCookie(xcb.Cookie):514 pass515class GetColorTableParameterivReply(xcb.Reply):516 def __init__(self, parent, offset=0):517 xcb.Reply.__init__(self, parent, offset)518 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)519 offset += 32520 self.data = xcb.List(parent, offset, self.n, 'i', 4)521class GetConvolutionFilterCookie(xcb.Cookie):522 pass523class GetConvolutionFilterReply(xcb.Reply):524 def __init__(self, parent, offset=0):525 xcb.Reply.__init__(self, parent, offset)526 (self.width, self.height,) = unpack_from('xx2x4x8xii8x', parent, offset)527 offset += 32528 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)529class GetConvolutionParameterfvCookie(xcb.Cookie):530 pass531class GetConvolutionParameterfvReply(xcb.Reply):532 def __init__(self, parent, offset=0):533 xcb.Reply.__init__(self, parent, offset)534 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)535 offset += 32536 self.data = xcb.List(parent, offset, self.n, 'f', 4)537class GetConvolutionParameterivCookie(xcb.Cookie):538 pass539class GetConvolutionParameterivReply(xcb.Reply):540 def __init__(self, parent, offset=0):541 xcb.Reply.__init__(self, parent, offset)542 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)543 offset += 32544 self.data = xcb.List(parent, offset, self.n, 'i', 4)545class GetSeparableFilterCookie(xcb.Cookie):546 pass547class GetSeparableFilterReply(xcb.Reply):548 def __init__(self, parent, offset=0):549 xcb.Reply.__init__(self, parent, offset)550 (self.row_w, self.col_h,) = unpack_from('xx2x4x8xii8x', parent, offset)551 offset += 32552 self.rows_and_cols = xcb.List(parent, offset, (self.length * 4), 'B', 1)553class GetHistogramCookie(xcb.Cookie):554 pass555class GetHistogramReply(xcb.Reply):556 def __init__(self, parent, offset=0):557 xcb.Reply.__init__(self, parent, offset)558 (self.width,) = unpack_from('xx2x4x8xi12x', parent, offset)559 offset += 32560 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)561class GetHistogramParameterfvCookie(xcb.Cookie):562 pass563class GetHistogramParameterfvReply(xcb.Reply):564 def __init__(self, parent, offset=0):565 xcb.Reply.__init__(self, parent, offset)566 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)567 offset += 32568 self.data = xcb.List(parent, offset, self.n, 'f', 4)569class GetHistogramParameterivCookie(xcb.Cookie):570 pass571class GetHistogramParameterivReply(xcb.Reply):572 def __init__(self, parent, offset=0):573 xcb.Reply.__init__(self, parent, offset)574 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)575 offset += 32576 self.data = xcb.List(parent, offset, self.n, 'i', 4)577class GetMinmaxCookie(xcb.Cookie):578 pass579class GetMinmaxReply(xcb.Reply):580 def __init__(self, parent, offset=0):581 xcb.Reply.__init__(self, parent, offset)582 offset += 32583 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)584class GetMinmaxParameterfvCookie(xcb.Cookie):585 pass586class GetMinmaxParameterfvReply(xcb.Reply):587 def __init__(self, parent, offset=0):588 xcb.Reply.__init__(self, parent, offset)589 (self.n, self.datum,) = unpack_from('xx2x4x4xIf12x', parent, offset)590 offset += 32591 self.data = xcb.List(parent, offset, self.n, 'f', 4)592class GetMinmaxParameterivCookie(xcb.Cookie):593 pass594class GetMinmaxParameterivReply(xcb.Reply):595 def __init__(self, parent, offset=0):596 xcb.Reply.__init__(self, parent, offset)597 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)598 offset += 32599 self.data = xcb.List(parent, offset, self.n, 'i', 4)600class GetCompressedTexImageARBCookie(xcb.Cookie):601 pass602class GetCompressedTexImageARBReply(xcb.Reply):603 def __init__(self, parent, offset=0):604 xcb.Reply.__init__(self, parent, offset)605 (self.size,) = unpack_from('xx2x4x8xi12x', parent, offset)606 offset += 32607 self.data = xcb.List(parent, offset, (self.length * 4), 'B', 1)608class GenQueriesARBCookie(xcb.Cookie):609 pass610class GenQueriesARBReply(xcb.Reply):611 def __init__(self, parent, offset=0):612 xcb.Reply.__init__(self, parent, offset)613 offset += 32614 self.data = xcb.List(parent, offset, self.length, 'I', 4)615class IsQueryARBCookie(xcb.Cookie):616 pass617class IsQueryARBReply(xcb.Reply):618 def __init__(self, parent, offset=0):619 xcb.Reply.__init__(self, parent, offset)620 (self.ret_val,) = unpack_from('xx2x4xI', parent, offset)621class GetQueryivARBCookie(xcb.Cookie):622 pass623class GetQueryivARBReply(xcb.Reply):624 def __init__(self, parent, offset=0):625 xcb.Reply.__init__(self, parent, offset)626 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)627 offset += 32628 self.data = xcb.List(parent, offset, self.n, 'i', 4)629class GetQueryObjectivARBCookie(xcb.Cookie):630 pass631class GetQueryObjectivARBReply(xcb.Reply):632 def __init__(self, parent, offset=0):633 xcb.Reply.__init__(self, parent, offset)634 (self.n, self.datum,) = unpack_from('xx2x4x4xIi12x', parent, offset)635 offset += 32636 self.data = xcb.List(parent, offset, self.n, 'i', 4)637class GetQueryObjectuivARBCookie(xcb.Cookie):638 pass639class GetQueryObjectuivARBReply(xcb.Reply):640 def __init__(self, parent, offset=0):641 xcb.Reply.__init__(self, parent, offset)642 (self.n, self.datum,) = unpack_from('xx2x4x4xII12x', parent, offset)643 offset += 32644 self.data = xcb.List(parent, offset, self.n, 'I', 4)645class glxExtension(xcb.Extension):646 def RenderChecked(self, context_tag, data_len, data):647 buf = cStringIO.StringIO()648 buf.write(pack('=xx2xI', context_tag))649 buf.write(str(buffer(array('B', data))))650 return self.send_request(xcb.Request(buf.getvalue(), 1, True, True),651 xcb.VoidCookie())652 def Render(self, context_tag, data_len, data):653 buf = cStringIO.StringIO()654 buf.write(pack('=xx2xI', context_tag))655 buf.write(str(buffer(array('B', data))))656 return self.send_request(xcb.Request(buf.getvalue(), 1, True, False),657 xcb.VoidCookie())658 def RenderLargeChecked(self, context_tag, request_num, request_total, data_len, data):659 buf = cStringIO.StringIO()660 buf.write(pack('=xx2xIHHI', context_tag, request_num, request_total, data_len))661 buf.write(str(buffer(array('B', data))))662 return self.send_request(xcb.Request(buf.getvalue(), 2, True, True),663 xcb.VoidCookie())664 def RenderLarge(self, context_tag, request_num, request_total, data_len, data):665 buf = cStringIO.StringIO()666 buf.write(pack('=xx2xIHHI', context_tag, request_num, request_total, data_len))667 buf.write(str(buffer(array('B', data))))668 return self.send_request(xcb.Request(buf.getvalue(), 2, True, False),669 xcb.VoidCookie())670 def CreateContextChecked(self, context, visual, screen, share_list, is_direct):671 buf = cStringIO.StringIO()672 buf.write(pack('=xx2xIIIIB3x', context, visual, screen, share_list, is_direct))673 return self.send_request(xcb.Request(buf.getvalue(), 3, True, True),674 xcb.VoidCookie())675 def CreateContext(self, context, visual, screen, share_list, is_direct):676 buf = cStringIO.StringIO()677 buf.write(pack('=xx2xIIIIB3x', context, visual, screen, share_list, is_direct))678 return self.send_request(xcb.Request(buf.getvalue(), 3, True, False),679 xcb.VoidCookie())680 def DestroyContextChecked(self, context):681 buf = cStringIO.StringIO()682 buf.write(pack('=xx2xI', context))683 return self.send_request(xcb.Request(buf.getvalue(), 4, True, True),684 xcb.VoidCookie())685 def DestroyContext(self, context):686 buf = cStringIO.StringIO()687 buf.write(pack('=xx2xI', context))688 return self.send_request(xcb.Request(buf.getvalue(), 4, True, False),689 xcb.VoidCookie())690 def MakeCurrent(self, drawable, context, old_context_tag):691 buf = cStringIO.StringIO()692 buf.write(pack('=xx2xIII', drawable, context, old_context_tag))693 return self.send_request(xcb.Request(buf.getvalue(), 5, False, True),694 MakeCurrentCookie(),695 MakeCurrentReply)696 def MakeCurrentUnchecked(self, drawable, context, old_context_tag):697 buf = cStringIO.StringIO()698 buf.write(pack('=xx2xIII', drawable, context, old_context_tag))699 return self.send_request(xcb.Request(buf.getvalue(), 5, False, False),700 MakeCurrentCookie(),701 MakeCurrentReply)702 def IsDirect(self, context):703 buf = cStringIO.StringIO()704 buf.write(pack('=xx2xI', context))705 return self.send_request(xcb.Request(buf.getvalue(), 6, False, True),706 IsDirectCookie(),707 IsDirectReply)708 def IsDirectUnchecked(self, context):709 buf = cStringIO.StringIO()710 buf.write(pack('=xx2xI', context))711 return self.send_request(xcb.Request(buf.getvalue(), 6, False, False),712 IsDirectCookie(),713 IsDirectReply)714 def QueryVersion(self, major_version, minor_version):715 buf = cStringIO.StringIO()716 buf.write(pack('=xx2xII', major_version, minor_version))717 return self.send_request(xcb.Request(buf.getvalue(), 7, False, True),718 QueryVersionCookie(),719 QueryVersionReply)720 def QueryVersionUnchecked(self, major_version, minor_version):721 buf = cStringIO.StringIO()722 buf.write(pack('=xx2xII', major_version, minor_version))723 return self.send_request(xcb.Request(buf.getvalue(), 7, False, False),724 QueryVersionCookie(),725 QueryVersionReply)726 def WaitGLChecked(self, context_tag):727 buf = cStringIO.StringIO()728 buf.write(pack('=xx2xI', context_tag))729 return self.send_request(xcb.Request(buf.getvalue(), 8, True, True),730 xcb.VoidCookie())731 def WaitGL(self, context_tag):732 buf = cStringIO.StringIO()733 buf.write(pack('=xx2xI', context_tag))734 return self.send_request(xcb.Request(buf.getvalue(), 8, True, False),735 xcb.VoidCookie())736 def WaitXChecked(self, context_tag):737 buf = cStringIO.StringIO()738 buf.write(pack('=xx2xI', context_tag))739 return self.send_request(xcb.Request(buf.getvalue(), 9, True, True),740 xcb.VoidCookie())741 def WaitX(self, context_tag):742 buf = cStringIO.StringIO()743 buf.write(pack('=xx2xI', context_tag))744 return self.send_request(xcb.Request(buf.getvalue(), 9, True, False),745 xcb.VoidCookie())746 def CopyContextChecked(self, src, dest, mask, src_context_tag):747 buf = cStringIO.StringIO()748 buf.write(pack('=xx2xIIII', src, dest, mask, src_context_tag))749 return self.send_request(xcb.Request(buf.getvalue(), 10, True, True),750 xcb.VoidCookie())751 def CopyContext(self, src, dest, mask, src_context_tag):752 buf = cStringIO.StringIO()753 buf.write(pack('=xx2xIIII', src, dest, mask, src_context_tag))754 return self.send_request(xcb.Request(buf.getvalue(), 10, True, False),755 xcb.VoidCookie())756 def SwapBuffersChecked(self, context_tag, drawable):757 buf = cStringIO.StringIO()758 buf.write(pack('=xx2xII', context_tag, drawable))759 return self.send_request(xcb.Request(buf.getvalue(), 11, True, True),760 xcb.VoidCookie())761 def SwapBuffers(self, context_tag, drawable):762 buf = cStringIO.StringIO()763 buf.write(pack('=xx2xII', context_tag, drawable))764 return self.send_request(xcb.Request(buf.getvalue(), 11, True, False),765 xcb.VoidCookie())766 def UseXFontChecked(self, context_tag, font, first, count, list_base):767 buf = cStringIO.StringIO()768 buf.write(pack('=xx2xIIIII', context_tag, font, first, count, list_base))769 return self.send_request(xcb.Request(buf.getvalue(), 12, True, True),770 xcb.VoidCookie())771 def UseXFont(self, context_tag, font, first, count, list_base):772 buf = cStringIO.StringIO()773 buf.write(pack('=xx2xIIIII', context_tag, font, first, count, list_base))774 return self.send_request(xcb.Request(buf.getvalue(), 12, True, False),775 xcb.VoidCookie())776 def CreateGLXPixmapChecked(self, screen, visual, pixmap, glx_pixmap):777 buf = cStringIO.StringIO()778 buf.write(pack('=xx2xIIII', screen, visual, pixmap, glx_pixmap))779 return self.send_request(xcb.Request(buf.getvalue(), 13, True, True),780 xcb.VoidCookie())781 def CreateGLXPixmap(self, screen, visual, pixmap, glx_pixmap):782 buf = cStringIO.StringIO()783 buf.write(pack('=xx2xIIII', screen, visual, pixmap, glx_pixmap))784 return self.send_request(xcb.Request(buf.getvalue(), 13, True, False),785 xcb.VoidCookie())786 def GetVisualConfigs(self, screen):787 buf = cStringIO.StringIO()788 buf.write(pack('=xx2xI', screen))789 return self.send_request(xcb.Request(buf.getvalue(), 14, False, True),790 GetVisualConfigsCookie(),791 GetVisualConfigsReply)792 def GetVisualConfigsUnchecked(self, screen):793 buf = cStringIO.StringIO()794 buf.write(pack('=xx2xI', screen))795 return self.send_request(xcb.Request(buf.getvalue(), 14, False, False),796 GetVisualConfigsCookie(),797 GetVisualConfigsReply)798 def DestroyGLXPixmapChecked(self, glx_pixmap):799 buf = cStringIO.StringIO()800 buf.write(pack('=xx2xI', glx_pixmap))801 return self.send_request(xcb.Request(buf.getvalue(), 15, True, True),802 xcb.VoidCookie())803 def DestroyGLXPixmap(self, glx_pixmap):804 buf = cStringIO.StringIO()805 buf.write(pack('=xx2xI', glx_pixmap))806 return self.send_request(xcb.Request(buf.getvalue(), 15, True, False),807 xcb.VoidCookie())808 def VendorPrivateChecked(self, vendor_code, context_tag, data_len, data):809 buf = cStringIO.StringIO()810 buf.write(pack('=xx2xII', vendor_code, context_tag))811 buf.write(str(buffer(array('B', data))))812 return self.send_request(xcb.Request(buf.getvalue(), 16, True, True),813 xcb.VoidCookie())814 def VendorPrivate(self, vendor_code, context_tag, data_len, data):815 buf = cStringIO.StringIO()816 buf.write(pack('=xx2xII', vendor_code, context_tag))817 buf.write(str(buffer(array('B', data))))818 return self.send_request(xcb.Request(buf.getvalue(), 16, True, False),819 xcb.VoidCookie())820 def VendorPrivateWithReply(self, vendor_code, context_tag, data_len, data):821 buf = cStringIO.StringIO()822 buf.write(pack('=xx2xII', vendor_code, context_tag))823 buf.write(str(buffer(array('B', data))))824 return self.send_request(xcb.Request(buf.getvalue(), 17, False, True),825 VendorPrivateWithReplyCookie(),826 VendorPrivateWithReplyReply)827 def VendorPrivateWithReplyUnchecked(self, vendor_code, context_tag, data_len, data):828 buf = cStringIO.StringIO()829 buf.write(pack('=xx2xII', vendor_code, context_tag))830 buf.write(str(buffer(array('B', data))))831 return self.send_request(xcb.Request(buf.getvalue(), 17, False, False),832 VendorPrivateWithReplyCookie(),833 VendorPrivateWithReplyReply)834 def QueryExtensionsString(self, screen):835 buf = cStringIO.StringIO()836 buf.write(pack('=xx2xI', screen))837 return self.send_request(xcb.Request(buf.getvalue(), 18, False, True),838 QueryExtensionsStringCookie(),839 QueryExtensionsStringReply)840 def QueryExtensionsStringUnchecked(self, screen):841 buf = cStringIO.StringIO()842 buf.write(pack('=xx2xI', screen))843 return self.send_request(xcb.Request(buf.getvalue(), 18, False, False),844 QueryExtensionsStringCookie(),845 QueryExtensionsStringReply)846 def QueryServerString(self, screen, name):847 buf = cStringIO.StringIO()848 buf.write(pack('=xx2xII', screen, name))849 return self.send_request(xcb.Request(buf.getvalue(), 19, False, True),850 QueryServerStringCookie(),851 QueryServerStringReply)852 def QueryServerStringUnchecked(self, screen, name):853 buf = cStringIO.StringIO()854 buf.write(pack('=xx2xII', screen, name))855 return self.send_request(xcb.Request(buf.getvalue(), 19, False, False),856 QueryServerStringCookie(),857 QueryServerStringReply)858 def ClientInfoChecked(self, major_version, minor_version, str_len, string):859 buf = cStringIO.StringIO()860 buf.write(pack('=xx2xIII', major_version, minor_version, str_len))861 buf.write(str(buffer(array('b', string))))862 return self.send_request(xcb.Request(buf.getvalue(), 20, True, True),863 xcb.VoidCookie())864 def ClientInfo(self, major_version, minor_version, str_len, string):865 buf = cStringIO.StringIO()866 buf.write(pack('=xx2xIII', major_version, minor_version, str_len))867 buf.write(str(buffer(array('b', string))))868 return self.send_request(xcb.Request(buf.getvalue(), 20, True, False),869 xcb.VoidCookie())870 def GetFBConfigs(self, screen):871 buf = cStringIO.StringIO()872 buf.write(pack('=xx2xI', screen))873 return self.send_request(xcb.Request(buf.getvalue(), 21, False, True),874 GetFBConfigsCookie(),875 GetFBConfigsReply)876 def GetFBConfigsUnchecked(self, screen):877 buf = cStringIO.StringIO()878 buf.write(pack('=xx2xI', screen))879 return self.send_request(xcb.Request(buf.getvalue(), 21, False, False),880 GetFBConfigsCookie(),881 GetFBConfigsReply)882 def CreatePixmapChecked(self, screen, fbconfig, pixmap, glx_pixmap, num_attribs, attribs):883 buf = cStringIO.StringIO()884 buf.write(pack('=xx2xIIIII', screen, fbconfig, pixmap, glx_pixmap, num_attribs))885 buf.write(str(buffer(array('I', attribs))))886 return self.send_request(xcb.Request(buf.getvalue(), 22, True, True),887 xcb.VoidCookie())888 def CreatePixmap(self, screen, fbconfig, pixmap, glx_pixmap, num_attribs, attribs):889 buf = cStringIO.StringIO()890 buf.write(pack('=xx2xIIIII', screen, fbconfig, pixmap, glx_pixmap, num_attribs))891 buf.write(str(buffer(array('I', attribs))))892 return self.send_request(xcb.Request(buf.getvalue(), 22, True, False),893 xcb.VoidCookie())894 def DestroyPixmapChecked(self, glx_pixmap):895 buf = cStringIO.StringIO()896 buf.write(pack('=xx2xI', glx_pixmap))897 return self.send_request(xcb.Request(buf.getvalue(), 23, True, True),898 xcb.VoidCookie())899 def DestroyPixmap(self, glx_pixmap):900 buf = cStringIO.StringIO()901 buf.write(pack('=xx2xI', glx_pixmap))902 return self.send_request(xcb.Request(buf.getvalue(), 23, True, False),903 xcb.VoidCookie())904 def CreateNewContextChecked(self, context, fbconfig, screen, render_type, share_list, is_direct):905 buf = cStringIO.StringIO()906 buf.write(pack('=xx2xIIIIIB3x', context, fbconfig, screen, render_type, share_list, is_direct))907 return self.send_request(xcb.Request(buf.getvalue(), 24, True, True),908 xcb.VoidCookie())909 def CreateNewContext(self, context, fbconfig, screen, render_type, share_list, is_direct):910 buf = cStringIO.StringIO()911 buf.write(pack('=xx2xIIIIIB3x', context, fbconfig, screen, render_type, share_list, is_direct))912 return self.send_request(xcb.Request(buf.getvalue(), 24, True, False),913 xcb.VoidCookie())914 def QueryContext(self, context):915 buf = cStringIO.StringIO()916 buf.write(pack('=xx2xI', context))917 return self.send_request(xcb.Request(buf.getvalue(), 25, False, True),918 QueryContextCookie(),919 QueryContextReply)920 def QueryContextUnchecked(self, context):921 buf = cStringIO.StringIO()922 buf.write(pack('=xx2xI', context))923 return self.send_request(xcb.Request(buf.getvalue(), 25, False, False),924 QueryContextCookie(),925 QueryContextReply)926 def MakeContextCurrent(self, old_context_tag, drawable, read_drawable, context):927 buf = cStringIO.StringIO()928 buf.write(pack('=xx2xIIII', old_context_tag, drawable, read_drawable, context))929 return self.send_request(xcb.Request(buf.getvalue(), 26, False, True),930 MakeContextCurrentCookie(),931 MakeContextCurrentReply)932 def MakeContextCurrentUnchecked(self, old_context_tag, drawable, read_drawable, context):933 buf = cStringIO.StringIO()934 buf.write(pack('=xx2xIIII', old_context_tag, drawable, read_drawable, context))935 return self.send_request(xcb.Request(buf.getvalue(), 26, False, False),936 MakeContextCurrentCookie(),937 MakeContextCurrentReply)938 def CreatePbufferChecked(self, screen, fbconfig, pbuffer, num_attribs, attribs):939 buf = cStringIO.StringIO()940 buf.write(pack('=xx2xIIII', screen, fbconfig, pbuffer, num_attribs))941 buf.write(str(buffer(array('I', attribs))))942 return self.send_request(xcb.Request(buf.getvalue(), 27, True, True),943 xcb.VoidCookie())944 def CreatePbuffer(self, screen, fbconfig, pbuffer, num_attribs, attribs):945 buf = cStringIO.StringIO()946 buf.write(pack('=xx2xIIII', screen, fbconfig, pbuffer, num_attribs))947 buf.write(str(buffer(array('I', attribs))))948 return self.send_request(xcb.Request(buf.getvalue(), 27, True, False),949 xcb.VoidCookie())950 def DestroyPbufferChecked(self, pbuffer):951 buf = cStringIO.StringIO()952 buf.write(pack('=xx2xI', pbuffer))953 return self.send_request(xcb.Request(buf.getvalue(), 28, True, True),954 xcb.VoidCookie())955 def DestroyPbuffer(self, pbuffer):956 buf = cStringIO.StringIO()957 buf.write(pack('=xx2xI', pbuffer))958 return self.send_request(xcb.Request(buf.getvalue(), 28, True, False),959 xcb.VoidCookie())960 def GetDrawableAttributes(self, drawable):961 buf = cStringIO.StringIO()962 buf.write(pack('=xx2xI', drawable))963 return self.send_request(xcb.Request(buf.getvalue(), 29, False, True),964 GetDrawableAttributesCookie(),965 GetDrawableAttributesReply)966 def GetDrawableAttributesUnchecked(self, drawable):967 buf = cStringIO.StringIO()968 buf.write(pack('=xx2xI', drawable))969 return self.send_request(xcb.Request(buf.getvalue(), 29, False, False),970 GetDrawableAttributesCookie(),971 GetDrawableAttributesReply)972 def ChangeDrawableAttributesChecked(self, drawable, num_attribs, attribs):973 buf = cStringIO.StringIO()974 buf.write(pack('=xx2xII', drawable, num_attribs))975 buf.write(str(buffer(array('I', attribs))))976 return self.send_request(xcb.Request(buf.getvalue(), 30, True, True),977 xcb.VoidCookie())978 def ChangeDrawableAttributes(self, drawable, num_attribs, attribs):979 buf = cStringIO.StringIO()980 buf.write(pack('=xx2xII', drawable, num_attribs))981 buf.write(str(buffer(array('I', attribs))))982 return self.send_request(xcb.Request(buf.getvalue(), 30, True, False),983 xcb.VoidCookie())984 def CreateWindowChecked(self, screen, fbconfig, window, glx_window, num_attribs, attribs):985 buf = cStringIO.StringIO()986 buf.write(pack('=xx2xIIIII', screen, fbconfig, window, glx_window, num_attribs))987 buf.write(str(buffer(array('I', attribs))))988 return self.send_request(xcb.Request(buf.getvalue(), 31, True, True),989 xcb.VoidCookie())990 def CreateWindow(self, screen, fbconfig, window, glx_window, num_attribs, attribs):991 buf = cStringIO.StringIO()992 buf.write(pack('=xx2xIIIII', screen, fbconfig, window, glx_window, num_attribs))993 buf.write(str(buffer(array('I', attribs))))994 return self.send_request(xcb.Request(buf.getvalue(), 31, True, False),995 xcb.VoidCookie())996 def DeleteWindowChecked(self, glxwindow):997 buf = cStringIO.StringIO()998 buf.write(pack('=xx2xI', glxwindow))999 return self.send_request(xcb.Request(buf.getvalue(), 32, True, True),1000 xcb.VoidCookie())1001 def DeleteWindow(self, glxwindow):1002 buf = cStringIO.StringIO()1003 buf.write(pack('=xx2xI', glxwindow))1004 return self.send_request(xcb.Request(buf.getvalue(), 32, True, False),1005 xcb.VoidCookie())1006 def SetClientInfoARBChecked(self, major_version, minor_version, num_versions, gl_str_len, glx_str_len, gl_versions, gl_extension_string, glx_extension_string):1007 buf = cStringIO.StringIO()1008 buf.write(pack('=xx2xIIIII', major_version, minor_version, num_versions, gl_str_len, glx_str_len))1009 buf.write(str(buffer(array('I', gl_versions))))1010 buf.write(str(buffer(array('b', gl_extension_string))))1011 buf.write(str(buffer(array('b', glx_extension_string))))1012 return self.send_request(xcb.Request(buf.getvalue(), 33, True, True),1013 xcb.VoidCookie())1014 def SetClientInfoARB(self, major_version, minor_version, num_versions, gl_str_len, glx_str_len, gl_versions, gl_extension_string, glx_extension_string):1015 buf = cStringIO.StringIO()1016 buf.write(pack('=xx2xIIIII', major_version, minor_version, num_versions, gl_str_len, glx_str_len))1017 buf.write(str(buffer(array('I', gl_versions))))1018 buf.write(str(buffer(array('b', gl_extension_string))))1019 buf.write(str(buffer(array('b', glx_extension_string))))1020 return self.send_request(xcb.Request(buf.getvalue(), 33, True, False),1021 xcb.VoidCookie())1022 def CreateContextAttribsARBChecked(self, context, fbconfig, screen, share_list, is_direct, num_attribs, attribs):1023 buf = cStringIO.StringIO()1024 buf.write(pack('=xx2xIIIIB3xI', context, fbconfig, screen, share_list, is_direct, num_attribs))1025 buf.write(str(buffer(array('I', attribs))))1026 return self.send_request(xcb.Request(buf.getvalue(), 34, True, True),1027 xcb.VoidCookie())1028 def CreateContextAttribsARB(self, context, fbconfig, screen, share_list, is_direct, num_attribs, attribs):1029 buf = cStringIO.StringIO()1030 buf.write(pack('=xx2xIIIIB3xI', context, fbconfig, screen, share_list, is_direct, num_attribs))1031 buf.write(str(buffer(array('I', attribs))))1032 return self.send_request(xcb.Request(buf.getvalue(), 34, True, False),1033 xcb.VoidCookie())1034 def SetClientInfo2ARBChecked(self, major_version, minor_version, num_versions, gl_str_len, glx_str_len, gl_versions, gl_extension_string, glx_extension_string):1035 buf = cStringIO.StringIO()1036 buf.write(pack('=xx2xIIIII', major_version, minor_version, num_versions, gl_str_len, glx_str_len))1037 buf.write(str(buffer(array('I', gl_versions))))1038 buf.write(str(buffer(array('b', gl_extension_string))))1039 buf.write(str(buffer(array('b', glx_extension_string))))1040 return self.send_request(xcb.Request(buf.getvalue(), 35, True, True),1041 xcb.VoidCookie())1042 def SetClientInfo2ARB(self, major_version, minor_version, num_versions, gl_str_len, glx_str_len, gl_versions, gl_extension_string, glx_extension_string):1043 buf = cStringIO.StringIO()1044 buf.write(pack('=xx2xIIIII', major_version, minor_version, num_versions, gl_str_len, glx_str_len))1045 buf.write(str(buffer(array('I', gl_versions))))1046 buf.write(str(buffer(array('b', gl_extension_string))))1047 buf.write(str(buffer(array('b', glx_extension_string))))1048 return self.send_request(xcb.Request(buf.getvalue(), 35, True, False),1049 xcb.VoidCookie())1050 def NewListChecked(self, context_tag, list, mode):1051 buf = cStringIO.StringIO()1052 buf.write(pack('=xx2xIII', context_tag, list, mode))1053 return self.send_request(xcb.Request(buf.getvalue(), 101, True, True),1054 xcb.VoidCookie())1055 def NewList(self, context_tag, list, mode):1056 buf = cStringIO.StringIO()1057 buf.write(pack('=xx2xIII', context_tag, list, mode))1058 return self.send_request(xcb.Request(buf.getvalue(), 101, True, False),1059 xcb.VoidCookie())1060 def EndListChecked(self, context_tag):1061 buf = cStringIO.StringIO()1062 buf.write(pack('=xx2xI', context_tag))1063 return self.send_request(xcb.Request(buf.getvalue(), 102, True, True),1064 xcb.VoidCookie())1065 def EndList(self, context_tag):1066 buf = cStringIO.StringIO()1067 buf.write(pack('=xx2xI', context_tag))1068 return self.send_request(xcb.Request(buf.getvalue(), 102, True, False),1069 xcb.VoidCookie())1070 def DeleteListsChecked(self, context_tag, list, range):1071 buf = cStringIO.StringIO()1072 buf.write(pack('=xx2xIIi', context_tag, list, range))1073 return self.send_request(xcb.Request(buf.getvalue(), 103, True, True),1074 xcb.VoidCookie())1075 def DeleteLists(self, context_tag, list, range):1076 buf = cStringIO.StringIO()1077 buf.write(pack('=xx2xIIi', context_tag, list, range))1078 return self.send_request(xcb.Request(buf.getvalue(), 103, True, False),1079 xcb.VoidCookie())1080 def GenLists(self, context_tag, range):1081 buf = cStringIO.StringIO()1082 buf.write(pack('=xx2xIi', context_tag, range))1083 return self.send_request(xcb.Request(buf.getvalue(), 104, False, True),1084 GenListsCookie(),1085 GenListsReply)1086 def GenListsUnchecked(self, context_tag, range):1087 buf = cStringIO.StringIO()1088 buf.write(pack('=xx2xIi', context_tag, range))1089 return self.send_request(xcb.Request(buf.getvalue(), 104, False, False),1090 GenListsCookie(),1091 GenListsReply)1092 def FeedbackBufferChecked(self, context_tag, size, type):1093 buf = cStringIO.StringIO()1094 buf.write(pack('=xx2xIii', context_tag, size, type))1095 return self.send_request(xcb.Request(buf.getvalue(), 105, True, True),1096 xcb.VoidCookie())1097 def FeedbackBuffer(self, context_tag, size, type):1098 buf = cStringIO.StringIO()1099 buf.write(pack('=xx2xIii', context_tag, size, type))1100 return self.send_request(xcb.Request(buf.getvalue(), 105, True, False),1101 xcb.VoidCookie())1102 def SelectBufferChecked(self, context_tag, size):1103 buf = cStringIO.StringIO()1104 buf.write(pack('=xx2xIi', context_tag, size))1105 return self.send_request(xcb.Request(buf.getvalue(), 106, True, True),1106 xcb.VoidCookie())1107 def SelectBuffer(self, context_tag, size):1108 buf = cStringIO.StringIO()1109 buf.write(pack('=xx2xIi', context_tag, size))1110 return self.send_request(xcb.Request(buf.getvalue(), 106, True, False),1111 xcb.VoidCookie())1112 def RenderMode(self, context_tag, mode):1113 buf = cStringIO.StringIO()1114 buf.write(pack('=xx2xII', context_tag, mode))1115 return self.send_request(xcb.Request(buf.getvalue(), 107, False, True),1116 RenderModeCookie(),1117 RenderModeReply)1118 def RenderModeUnchecked(self, context_tag, mode):1119 buf = cStringIO.StringIO()1120 buf.write(pack('=xx2xII', context_tag, mode))1121 return self.send_request(xcb.Request(buf.getvalue(), 107, False, False),1122 RenderModeCookie(),1123 RenderModeReply)1124 def Finish(self, context_tag):1125 buf = cStringIO.StringIO()1126 buf.write(pack('=xx2xI', context_tag))1127 return self.send_request(xcb.Request(buf.getvalue(), 108, False, True),1128 FinishCookie(),1129 FinishReply)1130 def FinishUnchecked(self, context_tag):1131 buf = cStringIO.StringIO()1132 buf.write(pack('=xx2xI', context_tag))1133 return self.send_request(xcb.Request(buf.getvalue(), 108, False, False),1134 FinishCookie(),1135 FinishReply)1136 def PixelStorefChecked(self, context_tag, pname, datum):1137 buf = cStringIO.StringIO()1138 buf.write(pack('=xx2xIIf', context_tag, pname, datum))1139 return self.send_request(xcb.Request(buf.getvalue(), 109, True, True),1140 xcb.VoidCookie())1141 def PixelStoref(self, context_tag, pname, datum):1142 buf = cStringIO.StringIO()1143 buf.write(pack('=xx2xIIf', context_tag, pname, datum))1144 return self.send_request(xcb.Request(buf.getvalue(), 109, True, False),1145 xcb.VoidCookie())1146 def PixelStoreiChecked(self, context_tag, pname, datum):1147 buf = cStringIO.StringIO()1148 buf.write(pack('=xx2xIIi', context_tag, pname, datum))1149 return self.send_request(xcb.Request(buf.getvalue(), 110, True, True),1150 xcb.VoidCookie())1151 def PixelStorei(self, context_tag, pname, datum):1152 buf = cStringIO.StringIO()1153 buf.write(pack('=xx2xIIi', context_tag, pname, datum))1154 return self.send_request(xcb.Request(buf.getvalue(), 110, True, False),1155 xcb.VoidCookie())1156 def ReadPixels(self, context_tag, x, y, width, height, format, type, swap_bytes, lsb_first):1157 buf = cStringIO.StringIO()1158 buf.write(pack('=xx2xIiiiiIIBB', context_tag, x, y, width, height, format, type, swap_bytes, lsb_first))1159 return self.send_request(xcb.Request(buf.getvalue(), 111, False, True),1160 ReadPixelsCookie(),1161 ReadPixelsReply)1162 def ReadPixelsUnchecked(self, context_tag, x, y, width, height, format, type, swap_bytes, lsb_first):1163 buf = cStringIO.StringIO()1164 buf.write(pack('=xx2xIiiiiIIBB', context_tag, x, y, width, height, format, type, swap_bytes, lsb_first))1165 return self.send_request(xcb.Request(buf.getvalue(), 111, False, False),1166 ReadPixelsCookie(),1167 ReadPixelsReply)1168 def GetBooleanv(self, context_tag, pname):1169 buf = cStringIO.StringIO()1170 buf.write(pack('=xx2xIi', context_tag, pname))1171 return self.send_request(xcb.Request(buf.getvalue(), 112, False, True),1172 GetBooleanvCookie(),1173 GetBooleanvReply)1174 def GetBooleanvUnchecked(self, context_tag, pname):1175 buf = cStringIO.StringIO()1176 buf.write(pack('=xx2xIi', context_tag, pname))1177 return self.send_request(xcb.Request(buf.getvalue(), 112, False, False),1178 GetBooleanvCookie(),1179 GetBooleanvReply)1180 def GetClipPlane(self, context_tag, plane):1181 buf = cStringIO.StringIO()1182 buf.write(pack('=xx2xIi', context_tag, plane))1183 return self.send_request(xcb.Request(buf.getvalue(), 113, False, True),1184 GetClipPlaneCookie(),1185 GetClipPlaneReply)1186 def GetClipPlaneUnchecked(self, context_tag, plane):1187 buf = cStringIO.StringIO()1188 buf.write(pack('=xx2xIi', context_tag, plane))1189 return self.send_request(xcb.Request(buf.getvalue(), 113, False, False),1190 GetClipPlaneCookie(),1191 GetClipPlaneReply)1192 def GetDoublev(self, context_tag, pname):1193 buf = cStringIO.StringIO()1194 buf.write(pack('=xx2xII', context_tag, pname))1195 return self.send_request(xcb.Request(buf.getvalue(), 114, False, True),1196 GetDoublevCookie(),1197 GetDoublevReply)1198 def GetDoublevUnchecked(self, context_tag, pname):1199 buf = cStringIO.StringIO()1200 buf.write(pack('=xx2xII', context_tag, pname))1201 return self.send_request(xcb.Request(buf.getvalue(), 114, False, False),1202 GetDoublevCookie(),1203 GetDoublevReply)1204 def GetError(self, context_tag):1205 buf = cStringIO.StringIO()1206 buf.write(pack('=xx2xI', context_tag))1207 return self.send_request(xcb.Request(buf.getvalue(), 115, False, True),1208 GetErrorCookie(),1209 GetErrorReply)1210 def GetErrorUnchecked(self, context_tag):1211 buf = cStringIO.StringIO()1212 buf.write(pack('=xx2xI', context_tag))1213 return self.send_request(xcb.Request(buf.getvalue(), 115, False, False),1214 GetErrorCookie(),1215 GetErrorReply)1216 def GetFloatv(self, context_tag, pname):1217 buf = cStringIO.StringIO()1218 buf.write(pack('=xx2xII', context_tag, pname))1219 return self.send_request(xcb.Request(buf.getvalue(), 116, False, True),1220 GetFloatvCookie(),1221 GetFloatvReply)1222 def GetFloatvUnchecked(self, context_tag, pname):1223 buf = cStringIO.StringIO()1224 buf.write(pack('=xx2xII', context_tag, pname))1225 return self.send_request(xcb.Request(buf.getvalue(), 116, False, False),1226 GetFloatvCookie(),1227 GetFloatvReply)1228 def GetIntegerv(self, context_tag, pname):1229 buf = cStringIO.StringIO()1230 buf.write(pack('=xx2xII', context_tag, pname))1231 return self.send_request(xcb.Request(buf.getvalue(), 117, False, True),1232 GetIntegervCookie(),1233 GetIntegervReply)1234 def GetIntegervUnchecked(self, context_tag, pname):1235 buf = cStringIO.StringIO()1236 buf.write(pack('=xx2xII', context_tag, pname))1237 return self.send_request(xcb.Request(buf.getvalue(), 117, False, False),1238 GetIntegervCookie(),1239 GetIntegervReply)1240 def GetLightfv(self, context_tag, light, pname):1241 buf = cStringIO.StringIO()1242 buf.write(pack('=xx2xIII', context_tag, light, pname))1243 return self.send_request(xcb.Request(buf.getvalue(), 118, False, True),1244 GetLightfvCookie(),1245 GetLightfvReply)1246 def GetLightfvUnchecked(self, context_tag, light, pname):1247 buf = cStringIO.StringIO()1248 buf.write(pack('=xx2xIII', context_tag, light, pname))1249 return self.send_request(xcb.Request(buf.getvalue(), 118, False, False),1250 GetLightfvCookie(),1251 GetLightfvReply)1252 def GetLightiv(self, context_tag, light, pname):1253 buf = cStringIO.StringIO()1254 buf.write(pack('=xx2xIII', context_tag, light, pname))1255 return self.send_request(xcb.Request(buf.getvalue(), 119, False, True),1256 GetLightivCookie(),1257 GetLightivReply)1258 def GetLightivUnchecked(self, context_tag, light, pname):1259 buf = cStringIO.StringIO()1260 buf.write(pack('=xx2xIII', context_tag, light, pname))1261 return self.send_request(xcb.Request(buf.getvalue(), 119, False, False),1262 GetLightivCookie(),1263 GetLightivReply)1264 def GetMapdv(self, context_tag, target, query):1265 buf = cStringIO.StringIO()1266 buf.write(pack('=xx2xIII', context_tag, target, query))1267 return self.send_request(xcb.Request(buf.getvalue(), 120, False, True),1268 GetMapdvCookie(),1269 GetMapdvReply)1270 def GetMapdvUnchecked(self, context_tag, target, query):1271 buf = cStringIO.StringIO()1272 buf.write(pack('=xx2xIII', context_tag, target, query))1273 return self.send_request(xcb.Request(buf.getvalue(), 120, False, False),1274 GetMapdvCookie(),1275 GetMapdvReply)1276 def GetMapfv(self, context_tag, target, query):1277 buf = cStringIO.StringIO()1278 buf.write(pack('=xx2xIII', context_tag, target, query))1279 return self.send_request(xcb.Request(buf.getvalue(), 121, False, True),1280 GetMapfvCookie(),1281 GetMapfvReply)1282 def GetMapfvUnchecked(self, context_tag, target, query):1283 buf = cStringIO.StringIO()1284 buf.write(pack('=xx2xIII', context_tag, target, query))1285 return self.send_request(xcb.Request(buf.getvalue(), 121, False, False),1286 GetMapfvCookie(),1287 GetMapfvReply)1288 def GetMapiv(self, context_tag, target, query):1289 buf = cStringIO.StringIO()1290 buf.write(pack('=xx2xIII', context_tag, target, query))1291 return self.send_request(xcb.Request(buf.getvalue(), 122, False, True),1292 GetMapivCookie(),1293 GetMapivReply)1294 def GetMapivUnchecked(self, context_tag, target, query):1295 buf = cStringIO.StringIO()1296 buf.write(pack('=xx2xIII', context_tag, target, query))1297 return self.send_request(xcb.Request(buf.getvalue(), 122, False, False),1298 GetMapivCookie(),1299 GetMapivReply)1300 def GetMaterialfv(self, context_tag, face, pname):1301 buf = cStringIO.StringIO()1302 buf.write(pack('=xx2xIII', context_tag, face, pname))1303 return self.send_request(xcb.Request(buf.getvalue(), 123, False, True),1304 GetMaterialfvCookie(),1305 GetMaterialfvReply)1306 def GetMaterialfvUnchecked(self, context_tag, face, pname):1307 buf = cStringIO.StringIO()1308 buf.write(pack('=xx2xIII', context_tag, face, pname))1309 return self.send_request(xcb.Request(buf.getvalue(), 123, False, False),1310 GetMaterialfvCookie(),1311 GetMaterialfvReply)1312 def GetMaterialiv(self, context_tag, face, pname):1313 buf = cStringIO.StringIO()1314 buf.write(pack('=xx2xIII', context_tag, face, pname))1315 return self.send_request(xcb.Request(buf.getvalue(), 124, False, True),1316 GetMaterialivCookie(),1317 GetMaterialivReply)1318 def GetMaterialivUnchecked(self, context_tag, face, pname):1319 buf = cStringIO.StringIO()1320 buf.write(pack('=xx2xIII', context_tag, face, pname))1321 return self.send_request(xcb.Request(buf.getvalue(), 124, False, False),1322 GetMaterialivCookie(),1323 GetMaterialivReply)1324 def GetPixelMapfv(self, context_tag, map):1325 buf = cStringIO.StringIO()1326 buf.write(pack('=xx2xII', context_tag, map))1327 return self.send_request(xcb.Request(buf.getvalue(), 125, False, True),1328 GetPixelMapfvCookie(),1329 GetPixelMapfvReply)1330 def GetPixelMapfvUnchecked(self, context_tag, map):1331 buf = cStringIO.StringIO()1332 buf.write(pack('=xx2xII', context_tag, map))1333 return self.send_request(xcb.Request(buf.getvalue(), 125, False, False),1334 GetPixelMapfvCookie(),1335 GetPixelMapfvReply)1336 def GetPixelMapuiv(self, context_tag, map):1337 buf = cStringIO.StringIO()1338 buf.write(pack('=xx2xII', context_tag, map))1339 return self.send_request(xcb.Request(buf.getvalue(), 126, False, True),1340 GetPixelMapuivCookie(),1341 GetPixelMapuivReply)1342 def GetPixelMapuivUnchecked(self, context_tag, map):1343 buf = cStringIO.StringIO()1344 buf.write(pack('=xx2xII', context_tag, map))1345 return self.send_request(xcb.Request(buf.getvalue(), 126, False, False),1346 GetPixelMapuivCookie(),1347 GetPixelMapuivReply)1348 def GetPixelMapusv(self, context_tag, map):1349 buf = cStringIO.StringIO()1350 buf.write(pack('=xx2xII', context_tag, map))1351 return self.send_request(xcb.Request(buf.getvalue(), 127, False, True),1352 GetPixelMapusvCookie(),1353 GetPixelMapusvReply)1354 def GetPixelMapusvUnchecked(self, context_tag, map):1355 buf = cStringIO.StringIO()1356 buf.write(pack('=xx2xII', context_tag, map))1357 return self.send_request(xcb.Request(buf.getvalue(), 127, False, False),1358 GetPixelMapusvCookie(),1359 GetPixelMapusvReply)1360 def GetPolygonStipple(self, context_tag, lsb_first):1361 buf = cStringIO.StringIO()1362 buf.write(pack('=xx2xIB', context_tag, lsb_first))1363 return self.send_request(xcb.Request(buf.getvalue(), 128, False, True),1364 GetPolygonStippleCookie(),1365 GetPolygonStippleReply)1366 def GetPolygonStippleUnchecked(self, context_tag, lsb_first):1367 buf = cStringIO.StringIO()1368 buf.write(pack('=xx2xIB', context_tag, lsb_first))1369 return self.send_request(xcb.Request(buf.getvalue(), 128, False, False),1370 GetPolygonStippleCookie(),1371 GetPolygonStippleReply)1372 def GetString(self, context_tag, name):1373 buf = cStringIO.StringIO()1374 buf.write(pack('=xx2xII', context_tag, name))1375 return self.send_request(xcb.Request(buf.getvalue(), 129, False, True),1376 GetStringCookie(),1377 GetStringReply)1378 def GetStringUnchecked(self, context_tag, name):1379 buf = cStringIO.StringIO()1380 buf.write(pack('=xx2xII', context_tag, name))1381 return self.send_request(xcb.Request(buf.getvalue(), 129, False, False),1382 GetStringCookie(),1383 GetStringReply)1384 def GetTexEnvfv(self, context_tag, target, pname):1385 buf = cStringIO.StringIO()1386 buf.write(pack('=xx2xIII', context_tag, target, pname))1387 return self.send_request(xcb.Request(buf.getvalue(), 130, False, True),1388 GetTexEnvfvCookie(),1389 GetTexEnvfvReply)1390 def GetTexEnvfvUnchecked(self, context_tag, target, pname):1391 buf = cStringIO.StringIO()1392 buf.write(pack('=xx2xIII', context_tag, target, pname))1393 return self.send_request(xcb.Request(buf.getvalue(), 130, False, False),1394 GetTexEnvfvCookie(),1395 GetTexEnvfvReply)1396 def GetTexEnviv(self, context_tag, target, pname):1397 buf = cStringIO.StringIO()1398 buf.write(pack('=xx2xIII', context_tag, target, pname))1399 return self.send_request(xcb.Request(buf.getvalue(), 131, False, True),1400 GetTexEnvivCookie(),1401 GetTexEnvivReply)1402 def GetTexEnvivUnchecked(self, context_tag, target, pname):1403 buf = cStringIO.StringIO()1404 buf.write(pack('=xx2xIII', context_tag, target, pname))1405 return self.send_request(xcb.Request(buf.getvalue(), 131, False, False),1406 GetTexEnvivCookie(),1407 GetTexEnvivReply)1408 def GetTexGendv(self, context_tag, coord, pname):1409 buf = cStringIO.StringIO()1410 buf.write(pack('=xx2xIII', context_tag, coord, pname))1411 return self.send_request(xcb.Request(buf.getvalue(), 132, False, True),1412 GetTexGendvCookie(),1413 GetTexGendvReply)1414 def GetTexGendvUnchecked(self, context_tag, coord, pname):1415 buf = cStringIO.StringIO()1416 buf.write(pack('=xx2xIII', context_tag, coord, pname))1417 return self.send_request(xcb.Request(buf.getvalue(), 132, False, False),1418 GetTexGendvCookie(),1419 GetTexGendvReply)1420 def GetTexGenfv(self, context_tag, coord, pname):1421 buf = cStringIO.StringIO()1422 buf.write(pack('=xx2xIII', context_tag, coord, pname))1423 return self.send_request(xcb.Request(buf.getvalue(), 133, False, True),1424 GetTexGenfvCookie(),1425 GetTexGenfvReply)1426 def GetTexGenfvUnchecked(self, context_tag, coord, pname):1427 buf = cStringIO.StringIO()1428 buf.write(pack('=xx2xIII', context_tag, coord, pname))1429 return self.send_request(xcb.Request(buf.getvalue(), 133, False, False),1430 GetTexGenfvCookie(),1431 GetTexGenfvReply)1432 def GetTexGeniv(self, context_tag, coord, pname):1433 buf = cStringIO.StringIO()1434 buf.write(pack('=xx2xIII', context_tag, coord, pname))1435 return self.send_request(xcb.Request(buf.getvalue(), 134, False, True),1436 GetTexGenivCookie(),1437 GetTexGenivReply)1438 def GetTexGenivUnchecked(self, context_tag, coord, pname):1439 buf = cStringIO.StringIO()1440 buf.write(pack('=xx2xIII', context_tag, coord, pname))1441 return self.send_request(xcb.Request(buf.getvalue(), 134, False, False),1442 GetTexGenivCookie(),1443 GetTexGenivReply)1444 def GetTexImage(self, context_tag, target, level, format, type, swap_bytes):1445 buf = cStringIO.StringIO()1446 buf.write(pack('=xx2xIIiIIB', context_tag, target, level, format, type, swap_bytes))1447 return self.send_request(xcb.Request(buf.getvalue(), 135, False, True),1448 GetTexImageCookie(),1449 GetTexImageReply)1450 def GetTexImageUnchecked(self, context_tag, target, level, format, type, swap_bytes):1451 buf = cStringIO.StringIO()1452 buf.write(pack('=xx2xIIiIIB', context_tag, target, level, format, type, swap_bytes))1453 return self.send_request(xcb.Request(buf.getvalue(), 135, False, False),1454 GetTexImageCookie(),1455 GetTexImageReply)1456 def GetTexParameterfv(self, context_tag, target, pname):1457 buf = cStringIO.StringIO()1458 buf.write(pack('=xx2xIII', context_tag, target, pname))1459 return self.send_request(xcb.Request(buf.getvalue(), 136, False, True),1460 GetTexParameterfvCookie(),1461 GetTexParameterfvReply)1462 def GetTexParameterfvUnchecked(self, context_tag, target, pname):1463 buf = cStringIO.StringIO()1464 buf.write(pack('=xx2xIII', context_tag, target, pname))1465 return self.send_request(xcb.Request(buf.getvalue(), 136, False, False),1466 GetTexParameterfvCookie(),1467 GetTexParameterfvReply)1468 def GetTexParameteriv(self, context_tag, target, pname):1469 buf = cStringIO.StringIO()1470 buf.write(pack('=xx2xIII', context_tag, target, pname))1471 return self.send_request(xcb.Request(buf.getvalue(), 137, False, True),1472 GetTexParameterivCookie(),1473 GetTexParameterivReply)1474 def GetTexParameterivUnchecked(self, context_tag, target, pname):1475 buf = cStringIO.StringIO()1476 buf.write(pack('=xx2xIII', context_tag, target, pname))1477 return self.send_request(xcb.Request(buf.getvalue(), 137, False, False),1478 GetTexParameterivCookie(),1479 GetTexParameterivReply)1480 def GetTexLevelParameterfv(self, context_tag, target, level, pname):1481 buf = cStringIO.StringIO()1482 buf.write(pack('=xx2xIIiI', context_tag, target, level, pname))1483 return self.send_request(xcb.Request(buf.getvalue(), 138, False, True),1484 GetTexLevelParameterfvCookie(),1485 GetTexLevelParameterfvReply)1486 def GetTexLevelParameterfvUnchecked(self, context_tag, target, level, pname):1487 buf = cStringIO.StringIO()1488 buf.write(pack('=xx2xIIiI', context_tag, target, level, pname))1489 return self.send_request(xcb.Request(buf.getvalue(), 138, False, False),1490 GetTexLevelParameterfvCookie(),1491 GetTexLevelParameterfvReply)1492 def GetTexLevelParameteriv(self, context_tag, target, level, pname):1493 buf = cStringIO.StringIO()1494 buf.write(pack('=xx2xIIiI', context_tag, target, level, pname))1495 return self.send_request(xcb.Request(buf.getvalue(), 139, False, True),1496 GetTexLevelParameterivCookie(),1497 GetTexLevelParameterivReply)1498 def GetTexLevelParameterivUnchecked(self, context_tag, target, level, pname):1499 buf = cStringIO.StringIO()1500 buf.write(pack('=xx2xIIiI', context_tag, target, level, pname))1501 return self.send_request(xcb.Request(buf.getvalue(), 139, False, False),1502 GetTexLevelParameterivCookie(),1503 GetTexLevelParameterivReply)1504 def IsList(self, context_tag, list):1505 buf = cStringIO.StringIO()1506 buf.write(pack('=xx2xII', context_tag, list))1507 return self.send_request(xcb.Request(buf.getvalue(), 141, False, True),1508 IsListCookie(),1509 IsListReply)1510 def IsListUnchecked(self, context_tag, list):1511 buf = cStringIO.StringIO()1512 buf.write(pack('=xx2xII', context_tag, list))1513 return self.send_request(xcb.Request(buf.getvalue(), 141, False, False),1514 IsListCookie(),1515 IsListReply)1516 def FlushChecked(self, context_tag):1517 buf = cStringIO.StringIO()1518 buf.write(pack('=xx2xI', context_tag))1519 return self.send_request(xcb.Request(buf.getvalue(), 142, True, True),1520 xcb.VoidCookie())1521 def Flush(self, context_tag):1522 buf = cStringIO.StringIO()1523 buf.write(pack('=xx2xI', context_tag))1524 return self.send_request(xcb.Request(buf.getvalue(), 142, True, False),1525 xcb.VoidCookie())1526 def AreTexturesResident(self, context_tag, n, textures):1527 buf = cStringIO.StringIO()1528 buf.write(pack('=xx2xIi', context_tag, n))1529 buf.write(str(buffer(array('I', textures))))1530 return self.send_request(xcb.Request(buf.getvalue(), 143, False, True),1531 AreTexturesResidentCookie(),1532 AreTexturesResidentReply)1533 def AreTexturesResidentUnchecked(self, context_tag, n, textures):1534 buf = cStringIO.StringIO()1535 buf.write(pack('=xx2xIi', context_tag, n))1536 buf.write(str(buffer(array('I', textures))))1537 return self.send_request(xcb.Request(buf.getvalue(), 143, False, False),1538 AreTexturesResidentCookie(),1539 AreTexturesResidentReply)1540 def DeleteTexturesChecked(self, context_tag, n, textures):1541 buf = cStringIO.StringIO()1542 buf.write(pack('=xx2xIi', context_tag, n))1543 buf.write(str(buffer(array('I', textures))))1544 return self.send_request(xcb.Request(buf.getvalue(), 144, True, True),1545 xcb.VoidCookie())1546 def DeleteTextures(self, context_tag, n, textures):1547 buf = cStringIO.StringIO()1548 buf.write(pack('=xx2xIi', context_tag, n))1549 buf.write(str(buffer(array('I', textures))))1550 return self.send_request(xcb.Request(buf.getvalue(), 144, True, False),1551 xcb.VoidCookie())1552 def GenTextures(self, context_tag, n):1553 buf = cStringIO.StringIO()1554 buf.write(pack('=xx2xIi', context_tag, n))1555 return self.send_request(xcb.Request(buf.getvalue(), 145, False, True),1556 GenTexturesCookie(),1557 GenTexturesReply)1558 def GenTexturesUnchecked(self, context_tag, n):1559 buf = cStringIO.StringIO()1560 buf.write(pack('=xx2xIi', context_tag, n))1561 return self.send_request(xcb.Request(buf.getvalue(), 145, False, False),1562 GenTexturesCookie(),1563 GenTexturesReply)1564 def IsTexture(self, context_tag, texture):1565 buf = cStringIO.StringIO()1566 buf.write(pack('=xx2xII', context_tag, texture))1567 return self.send_request(xcb.Request(buf.getvalue(), 146, False, True),1568 IsTextureCookie(),1569 IsTextureReply)1570 def IsTextureUnchecked(self, context_tag, texture):1571 buf = cStringIO.StringIO()1572 buf.write(pack('=xx2xII', context_tag, texture))1573 return self.send_request(xcb.Request(buf.getvalue(), 146, False, False),1574 IsTextureCookie(),1575 IsTextureReply)1576 def GetColorTable(self, context_tag, target, format, type, swap_bytes):1577 buf = cStringIO.StringIO()1578 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1579 return self.send_request(xcb.Request(buf.getvalue(), 147, False, True),1580 GetColorTableCookie(),1581 GetColorTableReply)1582 def GetColorTableUnchecked(self, context_tag, target, format, type, swap_bytes):1583 buf = cStringIO.StringIO()1584 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1585 return self.send_request(xcb.Request(buf.getvalue(), 147, False, False),1586 GetColorTableCookie(),1587 GetColorTableReply)1588 def GetColorTableParameterfv(self, context_tag, target, pname):1589 buf = cStringIO.StringIO()1590 buf.write(pack('=xx2xIII', context_tag, target, pname))1591 return self.send_request(xcb.Request(buf.getvalue(), 148, False, True),1592 GetColorTableParameterfvCookie(),1593 GetColorTableParameterfvReply)1594 def GetColorTableParameterfvUnchecked(self, context_tag, target, pname):1595 buf = cStringIO.StringIO()1596 buf.write(pack('=xx2xIII', context_tag, target, pname))1597 return self.send_request(xcb.Request(buf.getvalue(), 148, False, False),1598 GetColorTableParameterfvCookie(),1599 GetColorTableParameterfvReply)1600 def GetColorTableParameteriv(self, context_tag, target, pname):1601 buf = cStringIO.StringIO()1602 buf.write(pack('=xx2xIII', context_tag, target, pname))1603 return self.send_request(xcb.Request(buf.getvalue(), 149, False, True),1604 GetColorTableParameterivCookie(),1605 GetColorTableParameterivReply)1606 def GetColorTableParameterivUnchecked(self, context_tag, target, pname):1607 buf = cStringIO.StringIO()1608 buf.write(pack('=xx2xIII', context_tag, target, pname))1609 return self.send_request(xcb.Request(buf.getvalue(), 149, False, False),1610 GetColorTableParameterivCookie(),1611 GetColorTableParameterivReply)1612 def GetConvolutionFilter(self, context_tag, target, format, type, swap_bytes):1613 buf = cStringIO.StringIO()1614 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1615 return self.send_request(xcb.Request(buf.getvalue(), 150, False, True),1616 GetConvolutionFilterCookie(),1617 GetConvolutionFilterReply)1618 def GetConvolutionFilterUnchecked(self, context_tag, target, format, type, swap_bytes):1619 buf = cStringIO.StringIO()1620 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1621 return self.send_request(xcb.Request(buf.getvalue(), 150, False, False),1622 GetConvolutionFilterCookie(),1623 GetConvolutionFilterReply)1624 def GetConvolutionParameterfv(self, context_tag, target, pname):1625 buf = cStringIO.StringIO()1626 buf.write(pack('=xx2xIII', context_tag, target, pname))1627 return self.send_request(xcb.Request(buf.getvalue(), 151, False, True),1628 GetConvolutionParameterfvCookie(),1629 GetConvolutionParameterfvReply)1630 def GetConvolutionParameterfvUnchecked(self, context_tag, target, pname):1631 buf = cStringIO.StringIO()1632 buf.write(pack('=xx2xIII', context_tag, target, pname))1633 return self.send_request(xcb.Request(buf.getvalue(), 151, False, False),1634 GetConvolutionParameterfvCookie(),1635 GetConvolutionParameterfvReply)1636 def GetConvolutionParameteriv(self, context_tag, target, pname):1637 buf = cStringIO.StringIO()1638 buf.write(pack('=xx2xIII', context_tag, target, pname))1639 return self.send_request(xcb.Request(buf.getvalue(), 152, False, True),1640 GetConvolutionParameterivCookie(),1641 GetConvolutionParameterivReply)1642 def GetConvolutionParameterivUnchecked(self, context_tag, target, pname):1643 buf = cStringIO.StringIO()1644 buf.write(pack('=xx2xIII', context_tag, target, pname))1645 return self.send_request(xcb.Request(buf.getvalue(), 152, False, False),1646 GetConvolutionParameterivCookie(),1647 GetConvolutionParameterivReply)1648 def GetSeparableFilter(self, context_tag, target, format, type, swap_bytes):1649 buf = cStringIO.StringIO()1650 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1651 return self.send_request(xcb.Request(buf.getvalue(), 153, False, True),1652 GetSeparableFilterCookie(),1653 GetSeparableFilterReply)1654 def GetSeparableFilterUnchecked(self, context_tag, target, format, type, swap_bytes):1655 buf = cStringIO.StringIO()1656 buf.write(pack('=xx2xIIIIB', context_tag, target, format, type, swap_bytes))1657 return self.send_request(xcb.Request(buf.getvalue(), 153, False, False),1658 GetSeparableFilterCookie(),1659 GetSeparableFilterReply)1660 def GetHistogram(self, context_tag, target, format, type, swap_bytes, reset):1661 buf = cStringIO.StringIO()1662 buf.write(pack('=xx2xIIIIBB', context_tag, target, format, type, swap_bytes, reset))1663 return self.send_request(xcb.Request(buf.getvalue(), 154, False, True),1664 GetHistogramCookie(),1665 GetHistogramReply)1666 def GetHistogramUnchecked(self, context_tag, target, format, type, swap_bytes, reset):1667 buf = cStringIO.StringIO()1668 buf.write(pack('=xx2xIIIIBB', context_tag, target, format, type, swap_bytes, reset))1669 return self.send_request(xcb.Request(buf.getvalue(), 154, False, False),1670 GetHistogramCookie(),1671 GetHistogramReply)1672 def GetHistogramParameterfv(self, context_tag, target, pname):1673 buf = cStringIO.StringIO()1674 buf.write(pack('=xx2xIII', context_tag, target, pname))1675 return self.send_request(xcb.Request(buf.getvalue(), 155, False, True),1676 GetHistogramParameterfvCookie(),1677 GetHistogramParameterfvReply)1678 def GetHistogramParameterfvUnchecked(self, context_tag, target, pname):1679 buf = cStringIO.StringIO()1680 buf.write(pack('=xx2xIII', context_tag, target, pname))1681 return self.send_request(xcb.Request(buf.getvalue(), 155, False, False),1682 GetHistogramParameterfvCookie(),1683 GetHistogramParameterfvReply)1684 def GetHistogramParameteriv(self, context_tag, target, pname):1685 buf = cStringIO.StringIO()1686 buf.write(pack('=xx2xIII', context_tag, target, pname))1687 return self.send_request(xcb.Request(buf.getvalue(), 156, False, True),1688 GetHistogramParameterivCookie(),1689 GetHistogramParameterivReply)1690 def GetHistogramParameterivUnchecked(self, context_tag, target, pname):1691 buf = cStringIO.StringIO()1692 buf.write(pack('=xx2xIII', context_tag, target, pname))1693 return self.send_request(xcb.Request(buf.getvalue(), 156, False, False),1694 GetHistogramParameterivCookie(),1695 GetHistogramParameterivReply)1696 def GetMinmax(self, context_tag, target, format, type, swap_bytes, reset):1697 buf = cStringIO.StringIO()1698 buf.write(pack('=xx2xIIIIBB', context_tag, target, format, type, swap_bytes, reset))1699 return self.send_request(xcb.Request(buf.getvalue(), 157, False, True),1700 GetMinmaxCookie(),1701 GetMinmaxReply)1702 def GetMinmaxUnchecked(self, context_tag, target, format, type, swap_bytes, reset):1703 buf = cStringIO.StringIO()1704 buf.write(pack('=xx2xIIIIBB', context_tag, target, format, type, swap_bytes, reset))1705 return self.send_request(xcb.Request(buf.getvalue(), 157, False, False),1706 GetMinmaxCookie(),1707 GetMinmaxReply)1708 def GetMinmaxParameterfv(self, context_tag, target, pname):1709 buf = cStringIO.StringIO()1710 buf.write(pack('=xx2xIII', context_tag, target, pname))1711 return self.send_request(xcb.Request(buf.getvalue(), 158, False, True),1712 GetMinmaxParameterfvCookie(),1713 GetMinmaxParameterfvReply)1714 def GetMinmaxParameterfvUnchecked(self, context_tag, target, pname):1715 buf = cStringIO.StringIO()1716 buf.write(pack('=xx2xIII', context_tag, target, pname))1717 return self.send_request(xcb.Request(buf.getvalue(), 158, False, False),1718 GetMinmaxParameterfvCookie(),1719 GetMinmaxParameterfvReply)1720 def GetMinmaxParameteriv(self, context_tag, target, pname):1721 buf = cStringIO.StringIO()1722 buf.write(pack('=xx2xIII', context_tag, target, pname))1723 return self.send_request(xcb.Request(buf.getvalue(), 159, False, True),1724 GetMinmaxParameterivCookie(),1725 GetMinmaxParameterivReply)1726 def GetMinmaxParameterivUnchecked(self, context_tag, target, pname):1727 buf = cStringIO.StringIO()1728 buf.write(pack('=xx2xIII', context_tag, target, pname))1729 return self.send_request(xcb.Request(buf.getvalue(), 159, False, False),1730 GetMinmaxParameterivCookie(),1731 GetMinmaxParameterivReply)1732 def GetCompressedTexImageARB(self, context_tag, target, level):1733 buf = cStringIO.StringIO()1734 buf.write(pack('=xx2xIIi', context_tag, target, level))1735 return self.send_request(xcb.Request(buf.getvalue(), 160, False, True),1736 GetCompressedTexImageARBCookie(),1737 GetCompressedTexImageARBReply)1738 def GetCompressedTexImageARBUnchecked(self, context_tag, target, level):1739 buf = cStringIO.StringIO()1740 buf.write(pack('=xx2xIIi', context_tag, target, level))1741 return self.send_request(xcb.Request(buf.getvalue(), 160, False, False),1742 GetCompressedTexImageARBCookie(),1743 GetCompressedTexImageARBReply)1744 def DeleteQueriesARBChecked(self, context_tag, n, ids):1745 buf = cStringIO.StringIO()1746 buf.write(pack('=xx2xIi', context_tag, n))1747 buf.write(str(buffer(array('I', ids))))1748 return self.send_request(xcb.Request(buf.getvalue(), 161, True, True),1749 xcb.VoidCookie())1750 def DeleteQueriesARB(self, context_tag, n, ids):1751 buf = cStringIO.StringIO()1752 buf.write(pack('=xx2xIi', context_tag, n))1753 buf.write(str(buffer(array('I', ids))))1754 return self.send_request(xcb.Request(buf.getvalue(), 161, True, False),1755 xcb.VoidCookie())1756 def GenQueriesARB(self, context_tag, n):1757 buf = cStringIO.StringIO()1758 buf.write(pack('=xx2xIi', context_tag, n))1759 return self.send_request(xcb.Request(buf.getvalue(), 162, False, True),1760 GenQueriesARBCookie(),1761 GenQueriesARBReply)1762 def GenQueriesARBUnchecked(self, context_tag, n):1763 buf = cStringIO.StringIO()1764 buf.write(pack('=xx2xIi', context_tag, n))1765 return self.send_request(xcb.Request(buf.getvalue(), 162, False, False),1766 GenQueriesARBCookie(),1767 GenQueriesARBReply)1768 def IsQueryARB(self, context_tag, id):1769 buf = cStringIO.StringIO()1770 buf.write(pack('=xx2xII', context_tag, id))1771 return self.send_request(xcb.Request(buf.getvalue(), 163, False, True),1772 IsQueryARBCookie(),1773 IsQueryARBReply)1774 def IsQueryARBUnchecked(self, context_tag, id):1775 buf = cStringIO.StringIO()1776 buf.write(pack('=xx2xII', context_tag, id))1777 return self.send_request(xcb.Request(buf.getvalue(), 163, False, False),1778 IsQueryARBCookie(),1779 IsQueryARBReply)1780 def GetQueryivARB(self, context_tag, target, pname):1781 buf = cStringIO.StringIO()1782 buf.write(pack('=xx2xIII', context_tag, target, pname))1783 return self.send_request(xcb.Request(buf.getvalue(), 164, False, True),1784 GetQueryivARBCookie(),1785 GetQueryivARBReply)1786 def GetQueryivARBUnchecked(self, context_tag, target, pname):1787 buf = cStringIO.StringIO()1788 buf.write(pack('=xx2xIII', context_tag, target, pname))1789 return self.send_request(xcb.Request(buf.getvalue(), 164, False, False),1790 GetQueryivARBCookie(),1791 GetQueryivARBReply)1792 def GetQueryObjectivARB(self, context_tag, id, pname):1793 buf = cStringIO.StringIO()1794 buf.write(pack('=xx2xIII', context_tag, id, pname))1795 return self.send_request(xcb.Request(buf.getvalue(), 165, False, True),1796 GetQueryObjectivARBCookie(),1797 GetQueryObjectivARBReply)1798 def GetQueryObjectivARBUnchecked(self, context_tag, id, pname):1799 buf = cStringIO.StringIO()1800 buf.write(pack('=xx2xIII', context_tag, id, pname))1801 return self.send_request(xcb.Request(buf.getvalue(), 165, False, False),1802 GetQueryObjectivARBCookie(),1803 GetQueryObjectivARBReply)1804 def GetQueryObjectuivARB(self, context_tag, id, pname):1805 buf = cStringIO.StringIO()1806 buf.write(pack('=xx2xIII', context_tag, id, pname))1807 return self.send_request(xcb.Request(buf.getvalue(), 166, False, True),1808 GetQueryObjectuivARBCookie(),1809 GetQueryObjectuivARBReply)1810 def GetQueryObjectuivARBUnchecked(self, context_tag, id, pname):1811 buf = cStringIO.StringIO()1812 buf.write(pack('=xx2xIII', context_tag, id, pname))1813 return self.send_request(xcb.Request(buf.getvalue(), 166, False, False),1814 GetQueryObjectuivARBCookie(),1815 GetQueryObjectuivARBReply)1816_events = {1817 0 : PbufferClobberEvent,1818 1 : BufferSwapCompleteEvent,1819}1820_errors = {1821 -1 : (GenericError, BadGeneric),1822 0 : (ContextError, BadContext),1823 1 : (ContextStateError, BadContextState),1824 2 : (DrawableError, BadDrawable),1825 3 : (PixmapError, BadPixmap),1826 4 : (ContextTagError, BadContextTag),1827 5 : (CurrentWindowError, BadCurrentWindow),1828 6 : (RenderRequestError, BadRenderRequest),1829 7 : (LargeRequestError, BadLargeRequest),1830 8 : (UnsupportedPrivateRequestError, BadUnsupportedPrivateRequest),1831 9 : (FBConfigError, BadFBConfig),1832 10 : (PbufferError, BadPbuffer),1833 11 : (CurrentDrawableError, BadCurrentDrawable),1834 12 : (WindowError, BadWindow),1835 13 : (GLXBadProfileARBError, BadGLXBadProfileARB),1836}...

Full Screen

Full Screen

context.py

Source:context.py Github

copy

Full Screen

1import re2from bs4 import BeautifulSoup3from itertools import groupby4from settings import EMAIL_PATTERN, PHONE_PATTERN, NOT_A_NAME_DICTIONARY_PATH5NOT_A_NAME_PATTERN = r"([0-9@!&]"6with open(NOT_A_NAME_DICTIONARY_PATH, "r") as not_a_name_words:7 for w in not_a_name_words.readlines():8 NOT_A_NAME_PATTERN += r"|\b{}\b".format(w.strip())9NOT_A_NAME_PATTERN += r")"10re_email = re.compile(EMAIL_PATTERN, re.IGNORECASE)11re_not_a_name = re.compile(NOT_A_NAME_PATTERN, re.IGNORECASE)12re_lower_case_word = re.compile(r"(\b[a-z][A-Z]*[a-z]*\b|^[^A-za-z]+)")13re_phone = re.compile(PHONE_PATTERN, re.IGNORECASE)14def get_context(html_ner, html_name_stats, names):15 """16 Resolves name records and extract their context based on NER frequencies and HTML path patterns matching17 :param html_ner: HTML document in str format with predefined ner markup18 :param html_name_stats: list of HTML patterns, their frequencies, and NER matching19 :param names: list names in the string[] format20 :return: dictionary of resolved features21 """22 soup = BeautifulSoup(html_ner, "html.parser")23 # thresholds = sorted([loc["ner_freq"] for loc in locators_freq if loc["ner_freq"] > 1], reverse=True)24 resolved_names, resolution_confidence = _resolve_names(soup, html_name_stats, max(len(names) * 0.2, 1))25 resolved_context = _resolve_context(soup)26 return {"resolved_names": resolved_names,27 "resolved_context": resolved_context,28 "resolution_score": resolution_confidence}29def _resolve_names(soup, locators_freq, ner_thresh):30 """31 Resolve HTML paths as names based on the NER frequency threshold32 :param locators_freq: HTML path patterns and their NER counters in the dict[] format33 :param ner_thresh: resolution threshold34 :return: list of resolved names and the confidence estimation35 """36 # propagate is_ner=true property to tags with same locators as is_name=true37 resolved_nodes = []38 not_a_name_cnt = 039 is_single_word = True40 for locator in locators_freq:41 if locator["ner_freq"] >= ner_thresh:42 for tag in soup.findAll(path=locator["path"]):43 name = tag.string.strip()44 if not re_not_a_name.search(name) and not re_lower_case_word.search(name) and name:45 resolved_nodes.append((name, tag))46 if is_single_word:47 is_single_word = name.count(" ") == 048 else:49 resolved_nodes.append(("_NOT_A_NAME_" + str(ner_thresh) + " " + name, tag))50 not_a_name_cnt += 151 resolved_names = []52 for node in resolved_nodes:53 name = node[0]54 tag = node[1]55 if not name.startswith("_NOT_A_NAME_"):56 if not is_single_word and name.count(" ") == 0:57 resolved_names.append("_NOT_A_NAME_" + str(ner_thresh) + " " + name)58 not_a_name_cnt += 159 else:60 resolved_names.append(name)61 tag.attrs["is_name"] = True62 tag.attrs["names_below_cnt"] = 163 while tag.parent.name != "html":64 tag = tag.parent65 if "names_below_cnt" in tag.attrs:66 tag.attrs["names_below_cnt"] += 167 else:68 tag.attrs["names_below_cnt"] = 169 else:70 resolved_names.append(name)71 total_cnt = len(resolved_names)72 resolution_confidence = (1 - not_a_name_cnt / (total_cnt + .0)) if total_cnt > 0 else 073 return resolved_names, resolution_confidence74def _resolve_context(soup):75 """76 Extract context relevant to each name77 :return: list of context objects78 """79 # take the max subtree relevant to each name80 resolved_context = []81 for tag in soup.findAll(is_name=True):82 context_node = tag83 while "names_below_cnt" in context_node.parent.attrs and context_node.parent.attrs["names_below_cnt"] == 1:84 context_node = context_node.parent85 name, emails, phones, residuals, formatted_context, context_schema = _format_context(context_node)86 if name:87 if len(emails) == 0:88 email = "_none"89 elif len(emails) > 1:90 email = "_ambiguous"91 else:92 email = emails[0]93 if len(phones) == 0:94 phone = "_none"95 elif len(phones) > 1:96 phone = "_ambiguous"97 else:98 phone = phones[0]99 if len(residuals) == 0:100 role = "_none"101 elif email == "_ambiguous" or phone =="_ambiguous":102 role = "_ambiguous"103 else:104 role = ";".join(residuals)105 resolved_context.append({"name": name,106 "role": role,107 "email": email,108 "phone": phone,109 "xml_context": formatted_context,110 "schema": context_schema})111 schema_groups = dict((key, len(list(group))/len(resolved_context)) for key, group in112 groupby(sorted(resolved_context, key=lambda x: x["schema"]), key=lambda x: x["schema"]))113 resolved_context = [{**x, **{"cluster_score": schema_groups[x["schema"]]}} for x in resolved_context]114 return resolved_context115def _format_context(context_tag):116 """117 Reformatting the context of a named record118 :param context_tag: bs4 object of the context119 :return: list of extracted and formatted features120 """121 # remove all empty tags122 no_empty_tags = False123 while not no_empty_tags:124 removed = [empty_tag.extract() for empty_tag in125 context_tag.findAll(lambda tag: not tag.contents or tag.string == " ")]126 if len(removed) == 0:127 no_empty_tags = True128 # unwrap all redundant tags129 no_unwrapped_tags = False130 while not no_unwrapped_tags:131 unwrapped = [unwrap_tag.unwrap()132 for unwrap_tag in context_tag.findAll(133 lambda tag: "is_name" not in tag.attrs and len(list(tag.findChildren(recursive=False))) == 1)]134 if len(unwrapped) == 0:135 no_unwrapped_tags = True136 name = None137 emails = set()138 phones = []139 residuals = []140 # transform to formatted xml141 for tag in context_tag.findChildren(recursive=True):142 contents = tag.contents[0]143 if contents and isinstance(contents, str):144 contents = contents.strip()145 if contents != "":146 if "is_name" in tag.attrs:147 tag.name = "name"148 name = contents149 elif re_email.search(contents):150 tag.name = "email"151 emails.add(contents)152 elif re_phone.search(contents):153 tag.name = "phone"154 phones.append(contents)155 elif contents.lower() not in ["email"]:156 tag.name = "tag"157 residuals.append(contents)158 else:159 tag.unwrap()160 else:161 tag.unwrap()162 tag.attrs = {}163 first_order_children = list(context_tag.findChildren(recursive=False))164 if len(first_order_children) == 1 and first_order_children[0].name != "name":165 context_tag = first_order_children[0]166 context_tag.name = "person"167 context_tag.attrs = {}168 if not name and context_tag.string:169 name = context_tag.string.strip()170 context_tag = "<person><name>{}</name></person>".format(name)171 context_tag = str(context_tag)172 context_schema = re.sub(r"(?<=>)[^<>]+(?=<)", r"", context_tag)...

Full Screen

Full Screen

generator.py

Source:generator.py Github

copy

Full Screen

1from cocoa.model.generator import Templates as BaseTemplates, Generator as BaseGenerator2from cocoa.craigslist.core.tokenizer import detokenize3class Generator(BaseGenerator):4 def get_filter(5 self,6 used_templates=None,7 category=None,8 role=None,9 context_tag=None,10 tag=None,11 **kwargs12 ):13 locs = [super(Generator, self).get_filter(used_templates)]14 assert category and role15 self._add_filter(locs, self.templates.role == role)16 self._add_filter(locs, self.templates.category == category)17 if tag:18 self._add_filter(locs, self.templates.tag == tag)19 if context_tag:20 self._add_filter(locs, self.templates.context_tag == context_tag)21 return self._select_filter(locs)22class Templates(BaseTemplates):23 def ambiguous_template(self, template):24 """Check if there is ambiguity, in which case we will discard the template."""25 if len(template) == 0:26 return True27 num_prices = sum([1 if token == "{price}" else 0 for token in template])28 if num_prices > 1:29 return True30 num_titles = sum([1 if token == "{title}" else 0 for token in template])31 if num_titles > 1:32 return True33 return False34 def add_template(self, utterance, dialogue_state):35 if self.finalized:36 return37 if not utterance.template or self.ambiguous_template(utterance.template):38 return39 row = {40 "category": dialogue_state.kb.category,41 "role": dialogue_state.kb.role,42 "tag": utterance.lf.intent,43 "template": detokenize(utterance.template),44 "context_tag": dialogue_state.partner_act,45 "context": detokenize(dialogue_state.partner_template),46 "id": self.template_id,47 }48 # print 'add template:'49 # print 'context:', row['context']50 # print 'template:', row['template']51 self.template_id += 152 self.templates.append(row)53 def dump(self, n=-1):54 df = self.templates.groupby(["category", "role", "context_tag", "tag"])55 for group in df.groups:56 category, role, context_tag, response_tag = group57 if response_tag == "offer":58 continue59 print("=" * 40)60 print(61 "category={}, role={}, context={}, response={}".format(62 category, role, context_tag, response_tag63 )64 )65 print("=" * 40)66 rows = [x[1] for x in df.get_group(group).iterrows()]67 # rows = sorted(rows, key=lambda r: r['count'], reverse=True)68 for i, row in enumerate(rows):69 if i == n:70 break...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run unittest-xml-reporting automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful