bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def SetValue(self, value): if isinstance(value, float): wx.lib.masked.TimeCtrl.SetValue(self, "%02d:%02d" % (int(value), round((value - int(value)) * 60))) else: wx.lib.masked.TimeCtrl.SetValue(self, value) | def SetValue(self, value): if isinstance(value, float): wx.lib.masked.TimeCtrl.SetValue(self, "%02d:%02d" % (int(value), round((value - int(value)) * 60))) else: wx.lib.masked.TimeCtrl.SetValue(self, value) | 449,100 |
def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | 449,101 |
def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | 449,102 |
def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | def generateProductionOrders(): "generate production orders" print "Production:" empire = fo.getEmpire() totalPP = empire.productionPoints print "total Production Points: " + str(totalPP) print "possible building types to build:" possibleBuildingTypes = empire.availableBuildingTypes for buildingTypeID in possibleBui... | 449,103 |
def getPlanetHospitality(planetID): "returns a value depending on the planet type" universe = fo.getUniverse() planet = universe.getPlanet(planetID) if planet == None: return 0 # should be reworked with races if planet.type == fo.planetType.terran: return 2 if planet.type == fo.planetType.ocean: return 1 if planet.t... | def getPlanetHospitality(planetID): "returns a value depending on the planet type" universe = fo.getUniverse() planet = universe.getPlanet(planetID) if planet == None: return 0 # should be reworked with races if planetEnvironment == fo.planetEnvironment.good: return 2 if planetEnvironment == fo.planetEnvironme... | 449,104 |
def checklinks(site_url=None): return execute('jsr308_www_online=%s make -f %s checklinks' % (site_url, os.path.join(JSR308_LANGTOOLS, 'doc', 'Makefile')), halt_if_fail=False) | def checklinks(site_url=None): os.putenv('jsr308_www_online', site_url) return execute('make -f %s checklinks' % os.path.join(JSR308_LANGTOOLS, 'doc', 'Makefile'), halt_if_fail=False) | 449,105 |
def __init__(self, msg): self.msg = msg | def __init__(self, msg): self.msg = msg | 449,106 |
def main(argv): append_to_PATH() print("Making a new release of the Checker Framework!") # Infer version curr_version = current_distribution() print("Current release is %s" % curr_version) suggested_version = increment_version(curr_version) next_version = raw_input("Suggested next release: (%s): " % suggested_version)... | def main(argv): append_to_PATH() print("Making a new release of the Checker Framework!") # Infer version curr_version = current_distribution() print("Current release is %s" % curr_version) suggested_version = increment_version(curr_version) next_version = raw_input("Suggested next release: (%s): " % suggested_version)... | 449,107 |
def __init__(self, max_workers = 5, kill_workers_after = 3): if (not isinstance(max_workers, int)): raise TypeError("max_workers is not an int") if (max_workers < 1): raise ValueError('max_workers must be >= 1') if (not isinstance(kill_workers_after, int)): raise TypeError("kill_workers_after is not an int") self.__m... | def __init__(self, max_workers = 5, kill_workers_after = 3): if (not isinstance(max_workers, int)): raise TypeError("max_workers is not an int") if (max_workers < 1): raise ValueError('max_workers must be >= 1') if (not isinstance(kill_workers_after, int)): raise TypeError("kill_workers_after is not an int") self.__m... | 449,108 |
def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | 449,109 |
def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | 449,110 |
def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | def shutdown(self, wait_for_workers_period = 1, clean_shutdown_reties = 5): if (not isinstance(clean_shutdown_reties, int)): raise TypeError("clean_shutdown_reties is not an int") if (not clean_shutdown_reties >= 0): raise ValueError('clean_shutdown_reties must be >= 0') if (not isinstance(wait_for_workers_period, in... | 449,111 |
def punch_out(self): ''' Called by worker to update worker count when the worker is shutting down ''' with self.__active_workers_lock: self.__active_workers -= 1 | def punch_out(self): ''' Called by worker to update worker count when the worker is shutting down ''' with self.__worker_count_lock: self.__worker_count -= 1 | 449,112 |
def __new_worker(self): ''' Adding a new worker thread to the thread pool ''' with self.__active_workers_lock: ThreadPool.Worker(self) self.__active_workers += 1 | def __new_worker(self): ''' Adding a new worker thread to the thread pool ''' with self.__worker_count_lock: ThreadPool.Worker(self) self.__active_workers += 1 | 449,113 |
def __new_worker(self): ''' Adding a new worker thread to the thread pool ''' with self.__active_workers_lock: ThreadPool.Worker(self) self.__active_workers += 1 | def __new_worker(self): ''' Adding a new worker thread to the thread pool ''' with self.__active_workers_lock: ThreadPool.Worker(self) self.__worker_count += 1 def worker_active(self): with self.__worker_count_lock: self.__active_worker_count = self.__active_worker_count + 1 def worker_inactive(self): with self.__wor... | 449,114 |
def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | 449,115 |
def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | 449,116 |
def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | def add_job(self, function, args = None, return_callback=None): ''' Put new job into queue ''' if (not callable(function)): raise TypeError("function is not a callable") if (not ( args == None or isinstance(args, list))): raise TypeError("args is not a list") if (not (return_callback == None or callable(return_callbac... | 449,117 |
def _migrate_metadata(root_path, old_root_path, uid): dir_path = layoutmanager.get_instance().get_entry_path(uid) metadata_path = layoutmanager.get_instance().get_metadata_path(uid) os.makedirs(metadata_path) old_metadata_path = os.path.join(old_root_path, uid + '.metadata') metadata = cjson.decode(open(old_metadata_p... | def _migrate_metadata(root_path, old_root_path, uid): old_metadata_path = os.path.join(old_root_path, uid + '.metadata') metadata = cjson.decode(open(old_metadata_path, 'r').read()) if 'uid' not in metadata: metadata['uid'] = uid if 'timestamp' not in metadata and 'mtime' in metadata: metadata['timestamp'] = \ time.m... | 449,118 |
def __init__(self, **options): bus_name = dbus.service.BusName(DS_SERVICE, bus=dbus.SessionBus(), replace_existing=False, allow_replacement=False) dbus.service.Object.__init__(self, bus_name, DS_OBJECT_PATH) | def __init__(self, **options): bus_name = dbus.service.BusName(DS_SERVICE, bus=dbus.SessionBus(), replace_existing=False, allow_replacement=False) dbus.service.Object.__init__(self, bus_name, DS_OBJECT_PATH) | 449,119 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | 449,120 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | 449,121 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | 449,122 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print... | 449,123 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | 449,124 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print... | 449,125 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | 449,126 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending data" s.send(dataLenBytes) s.send(data) print "waiting on response" response = s.recv(999999) print "Got:" + response s.c... | defprint "received %s bytes" % len(imgData) client(server,port,data):print "received %s bytes" % len(imgData) sprint "received %s bytes" % len(imgData) =print "received %s bytes" % len(imgData) socket()print "received %s bytes" % len(imgData) printprint "received %s bytes" % len(imgData) "connectingprint "received %s b... | 449,127 |
def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | def client(server,port,data): s = socket() print "connecting to %s:%s" % (server,port) s.connect((server, port)) print "connected" dataLen = len(data) dataLenBytes = packSize(dataLen) print "sending %s bytes of data" % dataLen s.send(dataLenBytes) s.send(data) print "waiting on response" responseSizePacked = s.recv(pa... | 449,128 |
def _apply_annotations_param_ret_common(self, parent, node, tag): options = getattr(tag, 'options', {}) | def _apply_annotations_param_ret_common(self, parent, node, tag): options = getattr(tag, 'options', {}) | 449,129 |
def to_gtk_doc(self): lines = [self.name + ':'] tags = [] for name, tag in self.tags.iteritems(): if name in self.params: lines.append(tag.to_gtk_doc_param()) else: tags.append(tag) | def to_gtk_doc(self): lines = [self.name + ':'] tags = [] for name, tag in self.tags.iteritems(): if name in self.params: lines.append(tag.to_gtk_doc_param()) else: tags.append(tag) | 449,130 |
def validate(self): for option in self.options: value = self.options[option] if option == OPT_ALLOW_NONE: self._validate_option('allow-none', value, n_params=0) elif option == OPT_ARRAY: if value is None: continue for name, v in value.all().iteritems(): if name in [OPT_ARRAY_ZERO_TERMINATED, OPT_ARRAY_FIXED_SIZE]: try:... | def validate(self): for option in self.options: value = self.options[option] if option == OPT_ALLOW_NONE: self._validate_option('allow-none', value, n_params=0) elif option == OPT_ARRAY: if value is None: continue for name, v in value.all().iteritems(): if name in [OPT_ARRAY_ZERO_TERMINATED, OPT_ARRAY_FIXED_SIZE]: try:... | 449,131 |
def _parse_comment(self, cmt): # We're looking for gtk-doc comments here, they look like this: # /** # * symbol: # # Or, alternatively, with options: # /** # * symbol: (name value) ... # # symbol is currently one of: # - function: gtk_widget_show # - signal: GtkWidget::destroy # - property: GtkWidget:visible #... | def _parse_comment(self, cmt): # We're looking for gtk-doc comments here, they look like this: # /** # * symbol: # # Or, alternatively, with options: # /** # * symbol: (name value) ... # # symbol is currently one of: # - function: gtk_widget_show # - signal: GtkWidget::destroy # - property: GtkWidget:visible #... | 449,132 |
def _create_gobject(self, node): type_name = 'G' + node.name if type_name == 'GObject': parent_gitype = None symbol = 'intern' elif type_name == 'GInitiallyUnowned': parent_gitype = ast.Type(target_giname='GLib.Object') symbol = 'g_initially_unowned_get_type' else: assert False gnode = glibast.GLibObject(node.name, par... | def _create_gobject(self, node): type_name = 'G' + node.name if type_name == 'GObject': parent_gitype = None symbol = 'intern' elif type_name == 'GInitiallyUnowned': parent_gitype = ast.Type(target_giname='GObject.Object') symbol = 'g_initially_unowned_get_type' else: assert False gnode = glibast.GLibObject(node.name, ... | 449,133 |
def _create_enum(self, symbol): prefix = self._enum_common_prefix(symbol) if prefix: prefixlen = len(prefix) else: prefixlen = 0 members = [] for child in symbol.base_type.child_list: if prefixlen > 0: name = child.ident[prefixlen:] else: if child.private: continue # Ok, the enum members don't have a consistent prefix ... | def _create_enum(self, symbol): prefix = self._enum_common_prefix(symbol) if prefix: prefixlen = len(prefix) else: prefixlen = 0 members = [] for child in symbol.base_type.child_list: if prefixlen > 0: name = child.ident[prefixlen:] else: # Ok, the enum members don't have a consistent prefix # among them, so let's just... | 449,134 |
def __init__(self, namespace, accept_unprefixed=False): self._cachestore = CacheStore() self._accept_unprefixed = accept_unprefixed self._namespace = namespace self._pkg_config_packages = set() self._typedefs_ns = {} self._includes = {} self._include_names = set() self._includepaths = [] self._passthrough_mode = False | def __init__(self, namespace, accept_unprefixed=False): self._cachestore = CacheStore() self._accept_unprefixed = accept_unprefixed self._namespace = namespace self._pkg_config_packages = set() self._typedefs_ns = {} self._includes = {} self._include_names = set() self._includepaths = [] self._passthrough_mode = False | 449,135 |
def register_include_uninstalled(self, include_path): basename = os.path.basename(include_path) if not basename.endswith('.gir'): raise SystemExit( | def register_include_uninstalled(self, include_path): basename = os.path.basename(include_path) if not basename.endswith('.gir'): raise SystemExit( | 449,136 |
def _get_parameter_index(self, parent, param_name, location_name): index = parent.get_parameter_index(param_name) if index is None: raise InvalidAnnotationError( "can't find parameter %s referenced by parameter %s of %r" % (param_name, parent.name, location_name)) | def _get_parameter_index(self, parent, param_name, location_name): index = parent.get_parameter_index(param_name) if index is None: raise InvalidAnnotationError( "can't find parameter %s referenced by parameter %s of %r" % (param_name, parent.name, location_name)) | 449,137 |
def _parse_method_common(self, func, is_method): # Skip _get_type functions, we processed them # already if func.symbol.endswith('_get_type'): return None if self._namespace_name == 'GLib': # No GObjects in GLib return None | def _parse_method_common(self, func, is_method): # Skip _get_type functions, we processed them # already if func.symbol.endswith('_get_type'): return None if self._namespace_name == 'GLib': # No GObjects in GLib return None | 449,138 |
def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | def _get_annotation_name(self, node): if isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Enum, ast.Bitfield, ast.Callback)): if node.ctype is not None: block = self._blocks.get(node.ctype) else: block = self._blocks.get(node.c_name) self._apply_annotations_annotated(node, block) if isinstance(nod... | 449,139 |
def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | 449,140 |
def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | 449,141 |
def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._blocks.get(node.c_name) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class... | def _pass_read_annotations(self, node, chain): if not node.namespace: return False if isinstance(node, ast.Function): self._apply_annotations_function(node, chain) if isinstance(node, ast.Callback): block = self._get_block(node) self._apply_annotations_callable(node, chain, block) if isinstance(node, (ast.Class, ast.In... | 449,142 |
def _apply_annotations_property(self, parent, prop): block = self._blocks.get('%s:%s' % (parent.c_name, prop.name)) self._apply_annotations_annotated(prop, block) if not block: return transfer_tag = block.get(TAG_TRANSFER) if transfer_tag is not None: prop.transfer = transfer_tag.value else: prop.transfer = self._get_t... | def _apply_annotations_property(self, parent, prop): prefix = self._get_annotation_name(parent) block = self._blocks.get('%s:%s' % (prefix, prop.name)) self._apply_annotations_annotated(prop, block) if not block: return transfer_tag = block.get(TAG_TRANSFER) if transfer_tag is not None: prop.transfer = transfer_tag.val... | 449,143 |
def _apply_annotations_signal(self, parent, signal): block = self._blocks.get('%s::%s' % (parent.c_name, signal.name)) self._apply_annotations_annotated(signal, block) # We're only attempting to name the signal parameters if # the number of parameter tags (@foo) is the same or greater # than the number of signal parame... | def _apply_annotations_signal(self, parent, signal): prefix = self._get_annotation_name(parent) block = self._blocks.get('%s::%s' % (prefix, signal.name)) self._apply_annotations_annotated(signal, block) # We're only attempting to name the signal parameters if # the number of parameter tags (@foo) is the same or greate... | 449,144 |
def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, ast.Function): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.warn_node( parent, "... | def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, (ast.Function, ast.VFunction)): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.war... | 449,145 |
def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | 449,146 |
def _apply_annotations_enum(self, node, block): enum_type = block.options.get(OPT_TYPE) if enum_type and enum_type.one() == 'bitfield': node.__class__ = ast.Bitfield self._apply_annotations_annotated(node, block) | def _apply_annotations_enum(self, node, block): if block: enum_type = block.options.get(OPT_TYPE) if enum_type and enum_type.one() == 'bitfield': node.__class__ = ast.Bitfield self._apply_annotations_annotated(node, block) | 449,147 |
def _parse_attributes(self, node, block): annos_tag = self._get_tag(block, TAG_ATTRIBUTES) if annos_tag is None: return for key, value in annos_tag.options.iteritems(): node.attributes.append((key, value.one())) | def _parse_attributes(self, node, block): annos_tag = self._get_tag(block, TAG_ATTRIBUTES) if annos_tag is None: return for key, value in annos_tag.options.iteritems(): node.attributes.append((key, value.one())) | 449,148 |
def _introspect_enum(self, xmlnode): members = [] for member in xmlnode.findall('member'): # Keep the name closer to what we'd take from C by default; # see http://bugzilla.gnome.org/show_bug.cgi?id=575613 name = member.attrib['nick'].replace('-', '_') members.append(ast.Member(name, member.attrib['value'], member.attr... | def _introspect_enum(self, xmlnode): members = [] for member in xmlnode.findall('member'): # Keep the name closer to what we'd take from C by default; # see http://bugzilla.gnome.org/show_bug.cgi?id=575613 name = member.attrib['nick'].replace('-', '_') members.append(ast.Member(name, value, member.attrib['name'], membe... | 449,149 |
def _introspect_enum(self, xmlnode): members = [] for member in xmlnode.findall('member'): # Keep the name closer to what we'd take from C by default; # see http://bugzilla.gnome.org/show_bug.cgi?id=575613 name = member.attrib['nick'].replace('-', '_') members.append(ast.Member(name, member.attrib['value'], member.attr... | def _introspect_enum(self, xmlnode): members = [] for member in xmlnode.findall('member'): # Keep the name closer to what we'd take from C by default; # see http://bugzilla.gnome.org/show_bug.cgi?id=575613 name = member.attrib['nick'].replace('-', '_') members.append(ast.Member(name, member.attrib['value'], member.attr... | 449,150 |
def _pair_constructor(self, func, subsymbol): if not (func.symbol.find('_new_') >= 0 or func.symbol.endswith('_new')): return False target = self._transformer.lookup_typenode(func.retval.type) if not isinstance(target, (ast.Class, glibast.GLibBoxed)): return False new_idx = func.symbol.rfind('_new') assert (new_idx >= ... | def _pair_constructor(self, func, subsymbol): if not (func.symbol.find('_new_') >= 0 or func.symbol.endswith('_new')): return False target = self._transformer.lookup_typenode(func.retval.type) if not isinstance(target, (ast.Class, glibast.GLibBoxed)): return False new_idx = func.symbol.rfind('_new') assert (new_idx >= ... | 449,151 |
def _pair_constructor(self, func, subsymbol): if not (func.symbol.find('_new_') >= 0 or func.symbol.endswith('_new')): return False target = self._transformer.lookup_typenode(func.retval.type) if not isinstance(target, (ast.Class, glibast.GLibBoxed)): return False new_idx = func.symbol.rfind('_new') assert (new_idx >= ... | def _pair_constructor(self, func, subsymbol): if not (func.symbol.find('_new_') >= 0 or func.symbol.endswith('_new')): return False target = self._transformer.lookup_typenode(func.retval.type) if not isinstance(target, (ast.Class, glibast.GLibBoxed)): return False new_idx = func.symbol.rfind('_new') assert (new_idx >= ... | 449,152 |
def load_module(self, name): realpath = extract_libtool(self.path) mod = imp.load_module(name, open(realpath), realpath, ('.so', 'rb', 3)) mod.__loader__ = self return mod | def load_module(self, name): realpath = extract_libtool(self.path) platform_system = platform.system() if platform_system == 'Darwin': extension = '.dylib' elif platform_system == 'Windows': extension = '.dll' else: extension = '.so' mod = imp.load_module(name, open(realpath), realpath, (extension, 'rb', 3)) mod.__lo... | 449,153 |
def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | 449,154 |
def _open_tag(self, tag_name, attributes=None): if attributes is None: attributes = [] attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(tag_name) + 2) self.write_line('<%s%s>' % (tag_name, attrs)) | def _open_tag(self, tag_name, attributes=None): if attributes is None: attributes = [] attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(tag_name) + 2) self.write_line('<%s%s>' % (tag_name, attrs)) | 449,155 |
def _close_tag(self, tag_name): self.write_line('</%s>' % (tag_name, )) | def _close_tag(self, tag_name): self.write_line('</%s>' % (tag_name, )) | 449,156 |
def write_line(self, line='', indent=True, do_escape=False): if do_escape: line = escape(str(line)) | def write_line(self, line=u'', indent=True, do_escape=False): if isinstance(line, str): line = line.decode('utf-8') assert isinstance(line, unicode) if do_escape: line = escape(str(line)) | 449,157 |
def write_line(self, line='', indent=True, do_escape=False): if do_escape: line = escape(str(line)) | def write_line(self, line='', indent=True, do_escape=False): if do_escape: line = escape(str(line)) | 449,158 |
def write_line(self, line='', indent=True, do_escape=False): if do_escape: line = escape(str(line)) | def write_line(self, line='', indent=True, do_escape=False): if do_escape: line = escape(str(line)) | 449,159 |
def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = '<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (escape(data), tag_name) else: suffix = '/>' attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(prefix) + len(suffix))... | def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = u'<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (escape(data), tag_name) else: suffix = '/>' attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(prefix) + len(suffix)... | 449,160 |
def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = '<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (escape(data), tag_name) else: suffix = '/>' attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(prefix) + len(suffix))... | def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = '<%s' % (tag_name, ) if data is not None: if isinstance(data, str): data = data.decode('UTF-8') suffix = u'>%s</%s>' % (escape(data), tag_name) else: suffix = '/>' attrs = collect_attributes( tag_name, attributes, self... | 449,161 |
def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = '<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (escape(data), tag_name) else: suffix = '/>' attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(prefix) + len(suffix))... | def write_tag(self, tag_name, attributes, data=None): if attributes is None: attributes = [] prefix = '<%s' % (tag_name, ) if data is not None: suffix = '>%s</%s>' % (escape(data), tag_name) else: suffix = u'/>' attrs = collect_attributes( tag_name, attributes, self._indent, self._indent_char, len(prefix) + len(suffix)... | 449,162 |
def top_combiner(base, *rest): if orig_node is not None and isinstance(orig_node, ast.Type): base.is_const = orig_node.is_const return combiner(base, *rest) | def top_combiner(base, *rest): if orig_node is not None and isinstance(orig_node, ast.Type): base.is_const = orig_node.is_const return combiner(base, *rest) | 449,163 |
def top_combiner(base, *rest): if orig_node is not None and isinstance(orig_node, ast.Type): base.is_const = orig_node.is_const return combiner(base, *rest) | def top_combiner(base, *rest): if orig_node is not None and isinstance(orig_node, ast.Type): base.is_const = orig_node.is_const return combiner(base, *rest) | 449,164 |
def _introspectable_analysis(self, node, stack): if isinstance(node, TypeContainer): parent = stack[-1] if isinstance(node.type, Varargs): parent.introspectable = False elif not isinstance(node.type, List) and \ (node.type.name == 'GLib.List' or (self._transformer._namespace.name == 'GLib' and node.type.name == 'List')... | def _introspectable_analysis(self, node, stack): if isinstance(node, TypeContainer): parent = stack[-1] if isinstance(node.type, Varargs): parent.introspectable = False elif not isinstance(node.type, List) and \ (node.type.name == 'GLib.List' or (self._transformer._namespace.name == 'GLib' and (node.type.name == 'List'... | 449,165 |
def _apply_annotations_enum(self, node, block): if block: enum_type = block.options.get(OPT_TYPE) if enum_type and enum_type.one() == 'bitfield': node.__class__ = ast.Bitfield self._apply_annotations_annotated(node, block) | def _apply_annotations_enum(self, node, block): enum_type = block.options.get(OPT_TYPE) if enum_type and enum_type.one() == 'bitfield': node.__class__ = ast.Bitfield self._apply_annotations_annotated(node, block) | 449,166 |
def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() # Do not add -Wall when using init code as we do not include any # header of the library being introspected if self._compiler_cmd == 'gcc' and not self._options.init_sections: args.appe... | def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() # Do not add -Wall when using init code as we do not include any # header of the library being introspected if self._compiler_cmd == 'gcc' and not self._options.init_sections: args.appe... | 449,167 |
def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | 449,168 |
def _resolve_non_libtool(options, binary, libraries): if not libraries: return [] args = [] libtool = get_libtool_command(options) if libtool: args.extend(libtool) args.append('--mode=execute') args.extend(['ldd', binary.args[0]]) proc = subprocess.Popen(args, stdout=subprocess.PIPE) patterns = {} for library in libra... | def _resolve_non_libtool(options, binary, libraries): if not libraries: return [] args = [] libtool = get_libtool_command(options) if libtool: args.extend(libtool) args.append('--mode=execute') if platform.system() == 'Darwin': args.extend(['otool', '-L', binary.args[0]]) else: args.extend(['ldd', binary.args[0]]) pro... | 449,169 |
def _apply_annotations2_function(self, node, chain): # Handle virtual invokers parent = chain[-1] if chain else None block = self._blocks.get(node.symbol) if not (block and parent): return virtual = block.get(TAG_VFUNC) if not virtual: return invoker_name = virtual.value matched = False for vfunc in parent.virtual_meth... | def _apply_annotations2_function(self, node, chain): # Handle virtual invokers parent = chain[-1] if chain else None block = self._blocks.get(node.symbol) if not (block and parent): return virtual = block.get(TAG_VFUNC) if not virtual: return invoker_name = virtual.value matched = False for vfunc in parent.virtual_meth... | 449,170 |
def _get_option_parser(): parser = optparse.OptionParser('%prog [options] sources') parser.add_option('', "--quiet", action="store_true", dest="quiet", default=False, help="If passed, do not print details of normal" \ + " operation") parser.add_option("", "--format", action="store", dest="format", default="gir", help="... | def _get_option_parser(): parser = optparse.OptionParser('%prog [options] sources') parser.add_option('', "--quiet", action="store_true", dest="quiet", default=False, help="If passed, do not print details of normal" \ + " operation") parser.add_option("", "--format", action="store", dest="format", default="gir", help="... | 449,171 |
def scanner_main(args): parser = _get_option_parser() (options, args) = parser.parse_args(args) if options.passthrough_gir: passthrough_gir(options.passthrough_gir, sys.stdout) if options.test_codegen: return test_codegen(options.test_codegen) if len(args) <= 1: _error('Need at least one filename') if not options.na... | def scanner_main(args): parser = _get_option_parser() (options, args) = parser.parse_args(args) if options.passthrough_gir: passthrough_gir(options.passthrough_gir, sys.stdout) if options.test_codegen: return test_codegen(options.test_codegen) if len(args) <= 1: _error('Need at least one filename') if not options.na... | 449,172 |
def _pair_static_method(self, func, subsymbol): split = self._split_uscored_by_type(subsymbol) if split is None: return False (node, funcname) = split if not isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union, glibast.GLibBoxedOther)): return False self._namespace.float(func) func.name = funcname node.st... | def _pair_static_method(self, func, subsymbol): split = self._split_uscored_by_type(subsymbol) if split is None: return False (node, funcname) = split if not isinstance(node, (ast.Class, ast.Interface, ast.Record, ast.Union, glibast.GLibBoxedOther)): return False self._namespace.float(func) func.name = funcname node.st... | 449,173 |
def _resolve_type_from_ctype(self, typeval): assert typeval.ctype is not None pointer_stripped = typeval.ctype.replace('*', '') try: matches = self.split_ctype_namespaces(pointer_stripped) except ValueError, e: return False target_giname = None for namespace, name in matches: target = namespace.get(name) if not target:... | def _resolve_type_from_ctype(self, typeval): assert typeval.ctype is not None pointer_stripped = typeval.ctype.replace('*', '') try: matches = self.split_ctype_namespaces(pointer_stripped) except ValueError, e: return self._resolve_type_from_ctype_all_namespaces(typeval, pointer_stripped) target_giname = None for names... | 449,174 |
def _introspect_signals(self, node, xmlnode): for signal_info in xmlnode.findall('signal'): rctype = signal_info.attrib['return'] rtype = ast.Type.create_from_gtype_name(rctype) return_ = ast.Return(rtype) parameters = [] for i, parameter in enumerate(signal_info.findall('param')): if i == 0: argname = 'object' else: a... | def _introspect_signals(self, node, xmlnode): for signal_info in xmlnode.findall('signal'): rctype = signal_info.attrib['return'] rtype = ast.Type.create_from_gtype_name(rctype) return_ = ast.Return(rtype) parameters = [] for i, parameter in enumerate(signal_info.findall('param')): if i == 0: argname = 'object' else: a... | 449,175 |
def run(self): tpl_args = {} tpl_args['init_sections'] = "\n".join(self._options.init_sections) | def run(self): tpl_args = {} tpl_args['init_sections'] = "\n".join(self._options.init_sections) | 449,176 |
def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, ast.Function): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.warn( parent, "Inval... | def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, ast.Function): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.warn_node( parent, "... | 449,177 |
def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, ast.Function): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.warn( parent, "Inval... | def _apply_annotations_param(self, parent, param, tag): if tag: options = tag.options else: options = {} if isinstance(parent, ast.Function): scope = options.get(OPT_SCOPE) if scope: scope = scope.one() if scope not in [ast.PARAM_SCOPE_CALL, ast.PARAM_SCOPE_ASYNC, ast.PARAM_SCOPE_NOTIFIED]: message.warn( parent, "Inval... | 449,178 |
def _create_const(self, symbol): # Don't create constants for non-public things # http://bugzilla.gnome.org/show_bug.cgi?id=572790 if (symbol.source_filename is None or not symbol.source_filename.endswith('.h')): return None name = self.remove_prefix(symbol.ident) if symbol.const_string is not None: type_name = 'utf8' ... | def _create_const(self, symbol): # Don't create constants for non-public things # http://bugzilla.gnome.org/show_bug.cgi?id=572790 if (symbol.source_filename is None or not symbol.source_filename.endswith('.h')): return None name = self._strip_namespace_func(symbol.ident) if symbol.const_string is not None: type_name =... | 449,179 |
def _type_is_introspectable(self, typeval, warn=False): if not typeval.resolved: return False if isinstance(typeval, ast.TypeUnknown): return False if isinstance(typeval, (ast.Array, ast.List)): return self._type_is_introspectable(typeval.element_type) elif isinstance(typeval, ast.Map): return (self._type_is_introspect... | def _type_is_introspectable(self, typeval, warn=False): if not typeval.resolved: return False if isinstance(typeval, ast.TypeUnknown): return False if isinstance(typeval, (ast.Array, ast.List)): return self._type_is_introspectable(typeval.element_type) elif isinstance(typeval, ast.Map): return (self._type_is_introspect... | 449,180 |
def _write_type_ref(self, ntype): | def _write_type_ref(self, ntype): | 449,181 |
def _parse_method_common(self, func, is_method): # Skip _get_type functions, we processed them # already if func.symbol.endswith('_get_type'): return None if self._namespace_name == 'GLib': # No GObjects in GLib return None | def _parse_method_common(self, func, is_method): # Skip _get_type functions, we processed them # already if func.symbol.endswith('_get_type'): return None if self._namespace_name == 'GLib': # No GObjects in GLib return None | 449,182 |
def run(self): | def run(self): | 449,183 |
def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() | def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() | 449,184 |
def _subwalk(subnode): self._walk(subnode, callback, chain) | def _subwalk(subnode): self._walk(subnode, callback, chain) | 449,185 |
def top_combiner(base, *rest): if orig_node is not None: base.is_const = orig_node.is_const return combiner(base, *rest) | def top_combiner(base, *rest): if orig_node is not None and isinstance(orig_node, ast.Type): base.is_const = orig_node.is_const return combiner(base, *rest) | 449,186 |
def _apply_annotations_array(self, parent, node, options): array_opt = options.get(OPT_ARRAY) if array_opt: array_values = array_opt.all() else: array_values = {} | def _apply_annotations_array(self, parent, node, options): array_opt = options.get(OPT_ARRAY) if array_opt: array_values = array_opt.all() else: array_values = {} | 449,187 |
def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0]) elif isinstance(node.type, ast.Map): assert ... | def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0], parent) elif isinstance(node.type, ast.Map):... | 449,188 |
def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0]) elif isinstance(node.type, ast.Map): assert ... | def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0]) elif isinstance(node.type, ast.Map): assert ... | 449,189 |
def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0]) elif isinstance(node.type, ast.Map): assert ... | def _apply_annotations_element_type(self, parent, node, options): element_type_opt = options.get(OPT_ELEMENT_TYPE) element_type = element_type_opt.flat() if isinstance(node.type, ast.List): assert len(element_type) == 1 node.type.element_type = self._resolve(element_type[0], parent) elif isinstance(node.type, ast.Map):... | 449,190 |
def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | 449,191 |
def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | def _pair_method(self, func, subsymbol): if not func.parameters: return False first = func.parameters[0] target = self._transformer.lookup_typenode(first.type) if not isinstance(target, (ast.Class, ast.Interface, ast.Record, ast.Union, ast.Boxed)): return False if target.namespace != self._namespace: return False | 449,192 |
def _extract_container_type(self, parent, node, options): has_element_type = OPT_ELEMENT_TYPE in options has_array = OPT_ARRAY in options | def _extract_container_type(self, parent, node, options): has_element_type = OPT_ELEMENT_TYPE in options has_array = OPT_ARRAY in options | 449,193 |
def _parse_comment(self, cmt): # We're looking for gtk-doc comments here, they look like this: # /** # * symbol: # # Or, alternatively, with options: # /** # * symbol: (name value) ... # # symbol is currently one of: # - function: gtk_widget_show # - signal: GtkWidget::destroy # - property: GtkWidget:visible #... | def _parse_comment(self, cmt): # We're looking for gtk-doc comments here, they look like this: # /** # * symbol: # # Or, alternatively, with options: # /** # * symbol: (name value) ... # # symbol is currently one of: # - function: gtk_widget_show # - signal: GtkWidget::destroy # - property: GtkWidget:visible #... | 449,194 |
def _get_current_file(self): if not self._filename_stack: return None cwd = os.getcwd() + os.sep curfile = self._filename_stack[-1] if curfile.startswith(cwd): return curfile[len(cwd):] return curfile | def _get_current_file(self): if not self._filename_stack: return None cwd = os.getcwd() + os.sep curfile = self._filename_stack[-1] if curfile.startswith(cwd): return curfile[len(cwd):] return curfile | 449,195 |
def __init__(self, options, get_type_functions): self._options = options self._get_type_functions = get_type_functions # We have to use the current directory to work around Unix # sysadmins who mount /tmp noexec self._tmpdir = tempfile.mkdtemp('', 'tmp-introspect', dir=os.getcwd()) | def __init__(self, options, get_type_functions): self._options = options self._get_type_functions = get_type_functions # We have to use the current directory to work around Unix # sysadmins who mount /tmp noexec self._tmpdir = tempfile.mkdtemp('', 'tmp-introspect', dir=os.getcwd()) | 449,196 |
def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() # Do not add -Wall when using init code as we do not include any # header of the library being introspected if self._compiler_cmd == 'gcc' and not self._options.init_sections: args.appe... | def _compile(self, output, *sources): # Not strictly speaking correct, but easier than parsing shell args = self._compiler_cmd.split() # Do not add -Wall when using init code as we do not include any # header of the library being introspected if self._compiler_cmd == 'gcc' and not self._options.init_sections: args.appe... | 449,197 |
def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | 449,198 |
def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | def _link(self, output, *sources): args = [] libtool = get_libtool_command(self._options) if libtool: args.extend(libtool) args.append('--mode=link') args.append('--tag=CC') args.append('--silent') | 449,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.