rem
stringlengths
0
322k
add
stringlengths
0
2.05M
context
stringlengths
8
228k
self.snd.stop()
if self.snd: self.snd.stop()
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
raise
self.err.append( sys.exc_info() ) self.playingFile= None break
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
s= f.read( 512 ) r= dm.parse( s )
try: s= f.read( 512 ) r= dm.parse( s ) except: traceback.print_exc() self.err.append( sys.exc_info() ) self.playingFile= None continue
def _readerLoop( self ): f= None try: while self.exitFlag== 0: if self.playingFile== None: time.sleep( 0.01 ) continue self.length= self.frameNum= -1 # Initialize demuxer and read small portion of the file to have more info on the format self.err= [] if type( self.playingFile ) in ( str, unicode ): try: f= open( self....
the fourth parameter indicates if the search should be
the third parameter indicates if the search should be
def Search(self, text, wholewords=0, titleonly=0): '''Performs full-text search on the archive. The first parameter is the word to look for, the second indicates if the search should be for whole words only, and the fourth parameter indicates if the search should be restricted to page titles. This method will return a ...
print 'GetArchiveInfo:
sys.stderr.write('GetArchiveInfo:
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
print 'GetArchiveInfo: file size = 0'
sys.stderr.write('GetArchiveInfo: file size = 0\n')
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
print 'GetTopicsTree: file size = 0'
sys.stderr.write('GetTopicsTree: file size = 0\n')
def GetTopicsTree(self): '''Reads and returns the topics tree. This auxiliary function reads and returns the topics tree file contents for the CHM archive. ''' if (self.topics == None): return None
print 'GetIndex: file size = 0'
sys.stderr.write('GetIndex: file size = 0\n')
def GetIndex(self): '''Reads and returns the index tree. This auxiliary function reads and returns the index tree file contents for the CHM archive. ''' if (self.index == None): return None
if ((not self.topics) and (toc_index != 0)):
if (not self.topics):
def GetWindowsInfo(self): '''Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was not found in #SYSTEM (topics, index or default page. ''' result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS') if (result != chmlib.CHM_RESOLVE_SUCCESS): return -1
if ((not self.index) and (idx_index != 0)):
if (not self.index):
def GetWindowsInfo(self): '''Gets information from the #WINDOWS file. Checks the #WINDOWS file to see if it has any info that was not found in #SYSTEM (topics, index or default page. ''' result, ui = chmlib.chm_resolve_object(self.file, '/#WINDOWS') if (result != chmlib.CHM_RESOLVE_SUCCESS): return -1
if ((not self.topics) and (not self.index)): result, ui = chmlib.chm_resolve_object(self.file, '/ if (result != chmlib.CHM_RESOLVE_SUCCESS): print 'GetArchiveInfo: Could not find return 1 size, text = chmlib.chm_retrieve_object(self.file, ui, 1l, ui.length) if (size == 0): print 'GetArchiveInfo: STRINGS file size = 0'...
self.GetWindowsInfo()
def GetArchiveInfo(self): '''Obtains information on CHM archive. This function checks the /#SYSTEM file inside the CHM archive to obtain the index, home page, topics, encoding and title. It is called from LoadCHM. '''
print 'checking %s' % fullname
def lookupmodule(self, filename): """Helper function for break/clear parsing -- may be overridden.
return pdb.Pdb.default(self, line)
return pdb.Pdb.default(self, origLine)
def default(self, line): if line[0] == '!': line = line[1:] if self.handle_directive(line): return if line == '<<EOF': return self.multiline() if line.strip().endswith(':'): return self.multiline(line) if line.endswith('\\'): return self.multiline(line) origLine = line line = _removeQuotes(line) if line is None: return...
if self._historyPath: if os.path.exists(self._historyPath): readline.read_history_file(self._historyPath) atexit.register(self._save_history)
def __init__(self): self._exc_type = None self._exc_msg = None self._tb = None self._config = {} pdb.Pdb.__init__(self) if hasReadline: self._completer = erlcompleter.ECompleter() if self._historyPath: if os.path.exists(self._historyPath): readline.read_history_file(self._historyPath) atexit.register(self._save_histor...
def _save_history(self): if self._historyPath:
def read_history(self): if (hasReadline and self._historyPath and os.path.exists(self._historyPath)): readline.read_history_file(self._historyPath) def save_history(self): if hasReadline and self._historyPath: readline.set_history_length(1000)
def _save_history(self): if self._historyPath: readline.write_history_file(self._historyPath)
object.__setattr__(cls, attr_name, value)
type.__setattr__(cls, attr_name, value)
def __setattr__(cls, attr_name, value): # normal processing for private attributes if attr_name.startswith('_'): object.__setattr__(cls, attr_name, value) return # no '_': must be SimObject param param = cls.lookup_param(attr_name) if not param: raise AttributeError, \ "Class %s has no parameter %s" % (cls.__name__, at...
object.__setattr__(cls, attr_name, param.make_value(value))
type.__setattr__(cls, attr_name, param.make_value(value))
def __setattr__(cls, attr_name, value): # normal processing for private attributes if attr_name.startswith('_'): object.__setattr__(cls, attr_name, value) return # no '_': must be SimObject param param = cls.lookup_param(attr_name) if not param: raise AttributeError, \ "Class %s has no parameter %s" % (cls.__name__, at...
global __world__ __world__=self
_world=self
def __init__(self,digest_name="",uri_hash=None): """Create new RDF World object (constructor)""" self.world=Redland.librdf_new_world() Redland.librdf_world_open(self.world)
if __debug__:
global _debug if _debug:
def close(self): """Destroy RDF World object (destructor).""" if __debug__: print "Destroying RDF.world" self.me=None Redland.librdf_free_world(self.world)
def debug(self,value=0): global __debug__ if value: __debug__=value else: return __debug__
def debug(self,value= -1): if value >= 0: _debug=value else: return _debug
def debug(self,value=0): global __debug__ if value: __debug__=value else: return __debug__
if __debug__:
global _world global _debug if _debug:
def __init__(self, **args): """Create an RDF Node (constructor).""" if __debug__: print "Creating RDF.node args=",args self.node=None self.free_me=1
self.node=Redland.librdf_new_node_from_uri_string(__world__.world, args['uri_string'])
self.node=Redland.librdf_new_node_from_uri_string(_world.world, args['uri_string'])
def __init__(self, **args): """Create an RDF Node (constructor).""" if __debug__: print "Creating RDF.node args=",args self.node=None self.free_me=1
self.node=Redland.librdf_new_node_from_literal(__world__.world, args['literal'],xml_language,xml_space,is_wf_xml)
self.node=Redland.librdf_new_node_from_literal(_world.world, args['literal'],xml_language,xml_space,is_wf_xml)
def __init__(self, **args): """Create an RDF Node (constructor).""" if __debug__: print "Creating RDF.node args=",args self.node=None self.free_me=1
self.node=Redland.librdf_new_node(__world__.world)
self.node=Redland.librdf_new_node(_world.world)
def __init__(self, **args): """Create an RDF Node (constructor).""" if __debug__: print "Creating RDF.node args=",args self.node=None self.free_me=1
if __debug__:
global _debug if _debug:
def __del__(self): """Free an RDF Node (destructor).""" if __debug__: print "Destroying RDF.node" if self.node and self.free_me: if __debug__: print "Deleting Redland node object" Redland.librdf_free_node(self.node)
if __debug__:
if _debug:
def __del__(self): """Free an RDF Node (destructor).""" if __debug__: print "Destroying RDF.node" if self.node and self.free_me: if __debug__: print "Deleting Redland node object" Redland.librdf_free_node(self.node)
if __debug__:
global _world global _debug if _debug:
def __init__(self, **args): """Create an RDF Statement (constructor).""" if __debug__: print "Creating RDF.statement object args",args self.statement=None self.free_me=1
self.statement=Redland.librdf_new_statement_from_nodes(__world__.world, s, p, o)
self.statement=Redland.librdf_new_statement_from_nodes(_world.world, s, p, o)
def __init__(self, **args): """Create an RDF Statement (constructor).""" if __debug__: print "Creating RDF.statement object args",args self.statement=None self.free_me=1
self.statement=Redland.librdf_new_statement(__world__.world) def __del__(self): if __debug__:
self.statement=Redland.librdf_new_statement(_world.world) def __del__(self): global _debug if _debug:
def __init__(self, **args): """Create an RDF Statement (constructor).""" if __debug__: print "Creating RDF.statement object args",args self.statement=None self.free_me=1
if __debug__:
if _debug:
def __del__(self): if __debug__: print "Destroying RDF.statement" if self.statement and self.free_me: if __debug__: print "Deleting Redland statement object" Redland.librdf_free_statement(self.statement)
if __debug__:
global _world global _debug if _debug:
def __init__(self, storage, **args): """Create an RDF Model (constructor).""" if __debug__: print "Creating RDF.model args=",args self.model=None self.storage=None
self.model=Redland.librdf_new_model(__world__.world, storage.storage, args['options_string'])
self.model=Redland.librdf_new_model(_world.world, storage.storage, args['options_string'])
def __init__(self, storage, **args): """Create an RDF Model (constructor).""" if __debug__: print "Creating RDF.model args=",args self.model=None self.storage=None
self.model=Redland.librdf_new_model_with_options(__world__.world, storage.storage, args['options_hash'].hash)
self.model=Redland.librdf_new_model_with_options(_world.world, storage.storage, args['options_hash'].hash)
def __init__(self, storage, **args): """Create an RDF Model (constructor).""" if __debug__: print "Creating RDF.model args=",args self.model=None self.storage=None
self.model=Redland.librdf_new_model(__world__.world, storage.storage, "")
self.model=Redland.librdf_new_model(_world.world, storage.storage, "")
def __init__(self, storage, **args): """Create an RDF Model (constructor).""" if __debug__: print "Creating RDF.model args=",args self.model=None self.storage=None
if __debug__:
global _debug if _debug:
def __del__(self): if __debug__: print "Destroying RDF.model " if self.model: Redland.librdf_free_model(self.model)
if __debug__:
global _debug if _debug:
def __init__(self,object,creator): """Create an RDF Iterator (constructor).""" if __debug__: print "Creating RDF.iterator object=",object,"creator=",creator self.iterator=object; # Keep around a reference to the object that created the iterator # so that python does not destroy us before them. self.creator=creator;
if __debug__:
global _debug if _debug:
def __del__(self): if __debug__: print "Destroying RDF.iterator" Redland.librdf_free_iterator(self.iterator)
if __debug__:
global _debug if _debug:
def __init__(self, object, creator, free_statements): """Create an RDF Stream (constructor).""" if __debug__: print "Creating RDF.stream for object",object,"creator",creator,"free_statements",free_statements
if __debug__:
global _debug if _debug:
def __del__(self): if __debug__: print "Destroying RDF.stream" Redland.librdf_free_stream(self.stream)
if __debug__:
global _world global _debug if _debug:
def __init__(self, **args): """Create an RDF Storage (constructor).""" if __debug__: print "Creating RDF.storage args=",args self.storage=None
self.storage=Redland.librdf_new_storage(__world__.world, args['storage_name'] ,args['name'], args['options_string']);
self.storage=Redland.librdf_new_storage(_world.world, args['storage_name'] ,args['name'], args['options_string']);
def __init__(self, **args): """Create an RDF Storage (constructor).""" if __debug__: print "Creating RDF.storage args=",args self.storage=None
if __debug__:
global _debug if _debug:
def __del__(self): if __debug__: print "Destroying RDF.storage" if self.storage: Redland.librdf_free_storage(self.storage)
if __debug__:
global _world global _debug if _debug:
def __init__(self, **args): """Create an RDF URI (constructor).""" if __debug__: print "Creating RDF.uri args=",args self.uri=None
self.uri=Redland.librdf_new_uri(__world__.world, args['string'])
self.uri=Redland.librdf_new_uri(_world.world, args['string'])
def __init__(self, **args): """Create an RDF URI (constructor).""" if __debug__: print "Creating RDF.uri args=",args self.uri=None
if __debug__:
global _debug if _debug:
def __del__(self): if __debug__: print "Destroying RDF.uri" if self.uri: if __debug__: print "Deleting Redland uri object" Redland.librdf_free_uri(self.uri)
if __debug__:
if _debug:
def __del__(self): if __debug__: print "Destroying RDF.uri" if self.uri: if __debug__: print "Deleting Redland uri object" Redland.librdf_free_uri(self.uri)
if __debug__:
global _world global _debug if _debug:
def __init__(self, name, mime_type="", uri=None): """Create an RDF Parser (constructor).""" if __debug__: print "Creating RDF.parser name=",name,"mime_type=",mime_type,"uri=",uri
self.parser=Redland.librdf_new_parser(__world__.world, name, mime_type, uri) def __del__(self): if __debug__:
self.parser=Redland.librdf_new_parser(_world.world, name, mime_type, uri) def __del__(self): global _debug if _debug:
def __init__(self, name, mime_type="", uri=None): """Create an RDF Parser (constructor).""" if __debug__: print "Creating RDF.parser name=",name,"mime_type=",mime_type,"uri=",uri
expect = 559
expect = 410
def testSPARQLQueryAsString(self): q = SPARQLQuery("PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT * WHERE {?a dc:title ?c}") r = q.execute(self.model) expect = 559 self.assert_(r is not None, "execute to_string should have succeeded") s = r.to_string() self.assert_(len(s) == expect, "to_string should have return...
q = SPARQLQuery("PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?x ?y ?z WHERE {?x ?y ?z}")
q = SPARQLQuery("SELECT ?x ?y ?z WHERE {?x ?y ?z}")
def testSPARQLQueryTwice(self): q = SPARQLQuery("PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT ?x ?y ?z WHERE {?x ?y ?z}") results1 = q.execute(self.model) count1 = 0 for result in results1: count1 += 1 self.assert_(count1 == 3, "Should have found three results in execution 1")
results[n] = Node(from_object=v)
if v is None: results[n] = None else: results[n] = Node(from_object=v)
def make_results_hash(self): results = {} c = Redland.librdf_query_results_get_bindings_count(self._results) for i in range(c): n = Redland.librdf_query_results_get_binding_name(self._results,i) v = Redland.librdf_query_results_get_binding_value(self._results,i) results[n] = Node(from_object=v)
return Node(from_object=n, do_not_copy=1)
if n is None: return None else: return Node(from_object=n, do_not_copy=1)
def get_binding_value(self, offset): """Get the value of a variable binding by offset""" if not self.is_bindings(): raise RedlandError("Query result is not in variable bindings format") n=Redland.librdf_query_results_get_binding_value(self._results, offset) return Node(from_object=n, do_not_copy=1)
return Node(from_object=n, do_not_copy=1)
if n is None: return None; else: return Node(from_object=n, do_not_copy=1)
def get_binding_value_by_name(self, name): """Get the value of a variable binding by variable name""" if not self.is_bindings(): raise RedlandError("Query result is not in variable bindings format") n=Redland.librdf_query_results_get_binding_value_by_name(self._results, name) return Node(from_object=n, do_not_copy=1)
class RedlandWarning(RedlandError):
class RedlandWarning(Warning):
def __str__(self): return `self.value`
a = "file:../perl/dc.rdf"
a = "file:../data/dc.rdf"
def testParseIntoModel(self): a = "file:../perl/dc.rdf" self.parser.parse_into_model(self.model,a) self.assert_(len(self.model) == 3,"dc.rdf should have 3 statements")
a = "file:../perl/dc.rdf"
a = "file:../data/dc.rdf"
def testIterateModel(self): a = "file:../perl/dc.rdf" self.parser.parse_into_model(self.model,a) counter = 0 for s in self.model: counter += 1 self.assert_(counter == 3,"dc.rdf should have 3 statements")
a = "file:../perl/dc.rdf"
a = "file:../data/dc.rdf"
def testParseAsStream(self): a = "file:../perl/dc.rdf" for s in self.parser.parse_as_stream(a): self.model.append(s) self.assert_(len(self.model) == 3,"dc.rdf should have 3 statements")
self.parser.parse_into_model(self.model,"file:../perl/dc.rdf")
self.parser.parse_into_model(self.model,"file:../data/dc.rdf")
def testFindStatements1(self): self.parser.parse_into_model(self.model,"file:../perl/dc.rdf") statement = Statement( Uri("http://purl.org/net/dajobe/"), None, None)
self.parser.parse_into_model(self.model,"file:../perl/dc.rdf")
self.parser.parse_into_model(self.model,"file:../data/dc.rdf")
def testContains(self): self.parser.parse_into_model(self.model,"file:../perl/dc.rdf") statement = Statement( Uri("http://purl.org/net/dajobe/"), Uri("http://purl.org/dc/elements/1.1/creator"), "Dave Beckett")
a = "file:../perl/dc.rdf"
a = "file:../data/dc.rdf"
def testFindStatementsWithContext(self): a = "file:../perl/dc.rdf" intended_context = Node(Uri("http://example.org/")) for s in self.parser.parse_as_stream(a): self.model.append (s, intended_context)
if Redland.librdf_free_world is not None: Redland.librdf_free_world(self._world)
self._cleanup(self._world)
def __del__(self): """Destroy RDF World object (destructor).""" global _debug if _debug: print "Destroying RDF.World" # Sometimes the global destructor messes up and deletes # the Redland module before us if Redland.librdf_free_world is not None: Redland.librdf_free_world(self._world)
return self.as_stream()
return self.as_stream().__iter__()
def __iter__(self): return self.as_stream()
return hash(self._reduri)
return hash(str(self))
def __hash__(self): return hash(self._reduri)
Redland.librdf_free_world(self._world)
if Redland.librdf_free_world is not None: Redland.librdf_free_world(self._world)
def __del__(self): """Destroy RDF World object (destructor).""" global _debug if _debug: print "Destroying RDF.World" Redland.librdf_free_world(self._world)
def to_file(self, name, base_uri=None): """Serialize to filename name using the optional base URI."""
def to_file(self, name, format_uri=None, base_uri=None): """Serialize to filename name in syntax format_uri using the optional base URI.""" if type(format_uri) is str: format_uri = Uri(string = format_uri) elif type(format_uri) is unicode: import Redland_python format_uri = Uri(string=Redland_python.unicode_to_bytes(fo...
def to_file(self, name, base_uri=None): """Serialize to filename name using the optional base URI.""" if type(base_uri) is str: base_uri = Uri(string = base_uri) elif type(base_uri) is unicode: import Redland_python base_uri = Uri(string=Redland_python.unicode_to_bytes(base_uri)) if base_uri is not None: rbase_uri = ba...
return Redland.librdf_query_results_to_file(self._results, name, rbase_uri)
return Redland.librdf_query_results_to_file(self._results, name, rformat_uri, rbase_uri)
def to_file(self, name, base_uri=None): """Serialize to filename name using the optional base URI.""" if type(base_uri) is str: base_uri = Uri(string = base_uri) elif type(base_uri) is unicode: import Redland_python base_uri = Uri(string=Redland_python.unicode_to_bytes(base_uri)) if base_uri is not None: rbase_uri = ba...
'memory' is always present, and 'bdb' is available when BerkeleyDB is compiled in.
'memory', 'file' and 'uri' are always present. 'bdb' is available when BerkeleyDB is compiled in, 'mysql' when MySQL is compiled in, and 'sqlite' when SQLite is compiled in
def __init__(self, **args): """Create an RDF Storage (constructor).
If true, it allows updating of an existing Storage
If true, it deletes any existing store and creates a new one otherwise if false (default) open an existing store.
def __init__(self, **args): """Create an RDF Storage (constructor).
If false, the Storage is opened read-only and for file-based Storages or those with locks, may be shared-read.
If true (default) the Storage is opened read-write otherwise if false the storage is opened read-only and for file-based Storages or those with locks, may be opened with shared-readers.
def __init__(self, **args): """Create an RDF Storage (constructor).
def __init__(self, name="rdfxml", mime_type="application/rdf+xml", uri=None):
def __init__(self, name="rdfxml", mime_type="", uri=None):
def __init__(self, name="rdfxml", mime_type="application/rdf+xml", uri=None): """Create an RDF Parser (constructor).
return Serializer.__init__(self, name = "", mime_type = "application/rdf+xml", uri = None)
return Serializer.__init__(self, name = "rdfxml", mime_type = "", uri = None) class RDFXMLAbbrevSerializer(Serializer): """Redland RDF/XML with abbreviations Serializer class import RDF ser=RDF.RDFXMLAbbrevSerializer() """ def __init__(self): return Serializer.__init__(self, name = "rdfxml-abbrev", mime_type = "", ur...
def __init__(self): return Serializer.__init__(self, name = "", mime_type = "application/rdf+xml", uri = None)
return Iterator(my_iterator,self,source,predicate)
return Iterator(my_iterator,self)
def get_contexts(self): """Return a sequence of context Nodes in the Model."""
def __init__(self, hash_name, options):
def __init__(self, hash_name, options=""):
def __init__(self, hash_name, options): return Storage.__init__(self, name = hash_name, storage_name = "hashes", options_string = options)
datatype = datatype._reduri
rdatatype = datatype._reduri else: rdatatype = None
def add_typed_literal_statement(self,subject,predicate, string,xml_language=None,datatype=None): """Add the Statement (subject,predicate, typed literal) to the Model where the typed literal is constructed from the literal string, optional XML language and optional datatype URI. DEPRECATED. Use Model.append(Statement(s,...
subject_copy, predicate_copy, string, xml_language, datatype)
subject_copy, predicate_copy, string, xml_language, rdatatype)
def add_typed_literal_statement(self,subject,predicate, string,xml_language=None,datatype=None): """Add the Statement (subject,predicate, typed literal) to the Model where the typed literal is constructed from the literal string, optional XML language and optional datatype URI. DEPRECATED. Use Model.append(Statement(s,...
if uri is not None: uri = uri._reduri
if uri is None: raise TypeError("uri must be a string or RDF.Uri") ruri = uri._reduri
def load(self, uri, name="", mime_type="", type_uri=None): """Load triples into the Model from a URI in a syntax.
type_uri = type_uri._reduri Redland.librdf_model_load(self._model, uri, name, mime_type, type_uri)
rtype_uri = type_uri._reduri else: rtype_uri = None Redland.librdf_model_load(self._model, ruri, name, mime_type, rtype_uri)
def load(self, uri, name="", mime_type="", type_uri=None): """Load triples into the Model from a URI in a syntax.
base_uri = base_uri._reduri
rbase_uri = base_uri._reduri else: rbase_uri = None
def to_string(self, base_uri=None, name="", mime_type="", type_uri=None): """Serialize the Model to a syntax.
type_uri = type_uri._reduri return Redland.librdf_model_to_string(self._model, base_uri, name, mime_type, type_uri)
rtype_uri = type_uri._reduri else: rtype_uri = None return Redland.librdf_model_to_string(self._model, rbase_uri, name, mime_type, rtype_uri)
def to_string(self, base_uri=None, name="", mime_type="", type_uri=None): """Serialize the Model to a syntax.
uri=uri._reduri self._parser=Redland.librdf_new_parser(_world._world, name, mime_type, uri)
ruri=uri._reduri else: ruri=None self._parser=Redland.librdf_new_parser(_world._world, name, mime_type, ruri)
def __init__(self, name="rdfxml", mime_type="application/rdf+xml", uri=None): """Create an RDF Parser (constructor).
base_uri = base_uri._reduri
rbase_uri = base_uri._reduri else: rbase_uri = None
def __init__(self,querystring,base_uri=None,query_language="rdql"): if base_uri is not None: base_uri = base_uri._reduri global _world global _debug if _debug: print "Creating query for language '"+query_language+"', base '"+str(base_uri)+"': "+querystring
print "Creating query for language '"+query_language+"', base '"+str(base_uri)+"': "+querystring self._query = Redland.librdf_new_query(_world._world, query_language, base_uri, querystring)
print "Creating query for language '"+query_language+"', base '"+str(rbase_uri)+"': "+querystring self._query = Redland.librdf_new_query(_world._world, query_language, rbase_uri, querystring)
def __init__(self,querystring,base_uri=None,query_language="rdql"): if base_uri is not None: base_uri = base_uri._reduri global _world global _debug if _debug: print "Creating query for language '"+query_language+"', base '"+str(base_uri)+"': "+querystring
uri = uri._reduri
ruri = uri._reduri else: ruri = None
def __init__(self, name="", mime_type="application/rdf+xml", uri=None): """Create an RDF Serializer (constructor).""" global _world global _debug if _debug: print "Creating RDF.Serializer name=",name,"mime_type=",mime_type, \ "uri=",uri
mime_type, uri)
mime_type, ruri)
def __init__(self, name="", mime_type="application/rdf+xml", uri=None): """Create an RDF Serializer (constructor).""" global _world global _debug if _debug: print "Creating RDF.Serializer name=",name,"mime_type=",mime_type, \ "uri=",uri
base_uri = base_uri._reduri
rbase_uri = base_uri._reduri else: rbase_uri = None
def serialize_model_to_file(self, name, model, base_uri=None): """Serialize to filename name the Model model using the optional base URI.""" if base_uri is not None: base_uri = base_uri._reduri return Redland.librdf_serializer_serialize_model_to_file(self._serializer, name, base_uri, model._model)
name, base_uri, model._model)
name, rbase_uri, model._model)
def serialize_model_to_file(self, name, model, base_uri=None): """Serialize to filename name the Model model using the optional base URI.""" if base_uri is not None: base_uri = base_uri._reduri return Redland.librdf_serializer_serialize_model_to_file(self._serializer, name, base_uri, model._model)
print "Creating RDF.Statement object args",args
print "Creating RDF.Statement subject=",subject,"predicate=",predicate,"object=",object,"args=",args
def __init__(self, subject = None, predicate = None, object = None, **args): """Constructor for Statement.
def serialize_model_to_file (self, name, base_uri=None, model): if base_uri==None: base_uri=uri
def serialize_model_to_file (self, name, model, base_uri=None): if base_uri !=None: base_uri=base_uri._reduri
def serialize_model_to_file (self, name, base_uri=None, model): if base_uri==None: base_uri=uri return Redland.librdf_serializer_serialize_model_to_file(self._serializer, name, base_uri._reduri, model._model)
name, base_uri._reduri, model._model)
name, base_uri, model._model)
def serialize_model_to_file (self, name, base_uri=None, model): if base_uri==None: base_uri=uri return Redland.librdf_serializer_serialize_model_to_file(self._serializer, name, base_uri._reduri, model._model)
return self._set_type()
return self._set_type(value)
def __setattr__(self, name, value): if name=='uri': self._set_uri(value) elif name=='type': return self._set_type() else: self.__dict__[name]=value
self.assert_(len(s) == 301, "to_string should have returned 2 bytes not")
self.assert_(len(s) == 542, "to_string should have returned 301 bytes not " + str(len(s)))
def testSPARQLQueryAsString(self): q = SPARQLQuery("PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT * WHERE {?a dc:title ?c}") r = q.execute(self.model) self.assert_(r is not None, "execute to_string should have succeeded") s = r.to_string() self.assert_(len(s) == 301, "to_string should have returned 2 bytes not")
xml_language=""
xml_language=None
def __init__(self, arg = None, **args): """Create an RDF Node (constructor).
q2 = RDF.Query("- - -", name="triples")
q2 = RDF.Query("- - -", query_language="triples") q3 = RDF.Query("select $a where ...", query_language="sparql")
def __init__(self, uri = None): return Parser.__init__(self, name = "rss-tag-soup", mime_type="", uri=uri)
Create a Storage with the given name. Currently the built in storages are "memory" and "hashes". "hashes" takes extra arguments passed in the field options_string, some of which are required: options_string="hash-type='memory',new='yes',write='yes'" hash-type - required and can be the name of any Hash type supported....
Create a Storage of the given type. Currently the built in storage names that are always present are 'memory', 'hashes', 'file' and 'uri'. 'bdb' is available when Sleepycat / BerkeleyDB is compiled in, 'mysql' when MySQL is compiled in, and 'sqlite' when SQLite is compiled in Extra options can be passed with the opt...
def __init__(self, **args): """Create an RDF Storage (constructor).
('bugle_bank_heist',(IsZero('bugle_bank_heist'),),"BUGLE BROTHERS STRIKE AGAIN: Infamous for their bank heist on New Bremen two years ago, when they made off with over fifty million credits in a daring coup, the 'Bugle Brothers' selected the headquarters of the Cruyff Corporation as their target this time around. The...
('bugle_bank_heist',(IsZero('bugle_bank_heist'),),"BUGLE BROTHERS STRIKE AGAIN: Infamous for their bank heist on New Bremen two years ago, when they made off with over fifty million credits in a daring coup, the 'Bugle Brothers' selected the headquarters of the Cruyff Corporation as their target this time around. The...
def __nonzero__ (self): print 'nonzeroing' return saveVal(self.str)<0
significant=launch_recycle.launch_dockable_around_unit(dyn_fg,capshipfaction,"sitting_duck",1,2500,significant,"")
significant=launch_recycle.launch_dockable_around_unit(dyn_fg,capshipfaction,"sitting_duck",5000,significant,20000)
def __init__ (self,you, landable_only, distance_away_to_trigger,base_only=0,capshipfaction="", dyn_fg=""): self.obj=0 self.orbitee="" self.capship=0 self.you = you self.arrivedarea=0 self.distfrombase=distance_away_to_trigger significant=VS.Unit() self.sysfil=VS.getSystemFile() if (landable_only or base_only): randint=...
launchBaseOrbit (type,faction,un.GetPosition(),maxspeed*180,0,un)
launchBaseOrbit (type,faction,un.Position(),maxspeed*180,0,un)
def launchBaseStuck (type,faction): un=VS.getPlayer() maxspeed=100.1 if (un): maxspeed=un.maxAfterburnerSpeed()+30.1 un.setNull(); launchBaseOrbit (type,faction,un.GetPosition(),maxspeed*180,0,un)
item="radar_free_bsd"
item="SkyScope_Beta"
def getRandomRadar (): myint=random.randrange(0,3) item="radar_free_bsd" if (myint<=0): item="radar_windows_2k" elif (myint==1): item="radar_linux_SuSe" return item
item="radar_windows_2k"
item="StarScanner_2545"
def getRandomRadar (): myint=random.randrange(0,3) item="radar_free_bsd" if (myint<=0): item="radar_windows_2k" elif (myint==1): item="radar_linux_SuSe" return item
item="radar_linux_SuSe"
item="Hawkeye_ZX-86"
def getRandomRadar (): myint=random.randrange(0,3) item="radar_free_bsd" if (myint<=0): item="radar_windows_2k" elif (myint==1): item="radar_linux_SuSe" return item