Package horizons :: Package util :: Module preloader :: Class PreloadingThread
[hide private]
[frames] | no frames]

Class PreloadingThread

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        PreloadingThread

Preloads game data while in the main menu. Once a game is started, `wait_for_finish` is called to end the thread.

Instance Methods [hide private]
 
__init__(self)
This constructor should always be called with keyword arguments.
source code
 
run(self)
Preloads game data.
source code
 
wait_for_finish(self)
Wait for preloading to finish.
source code

Inherited from threading.Thread: __repr__, daemon, getName, ident, isAlive, isDaemon, is_alive, join, name, setDaemon, setName, start

Inherited from threading.Thread (private): _block, _reset_internal_locks, _set_daemon, _set_ident

Inherited from threading._Verbose (private): _note

    Inherited from object
 
__delattr__(...)
x.__delattr__('name') <==> del x.name
 
__format__(...)
default object formatter
 
__getattribute__(...)
x.__getattribute__('name') <==> x.name
 
__hash__(x)
hash(x)
a new object with type S, a subtype of T
__new__(T, S, ...)
 
__reduce__(...)
helper for pickle
 
__reduce_ex__(...)
helper for pickle
 
__setattr__(...)
x.__setattr__('name', value) <==> x.name = value
int
__sizeof__()
size of object in memory, in bytes
 
__str__(x)
str(x)
 
__subclasshook__(...)
Abstract classes can override this to customize issubclass().
Properties [hide private]
    Inherited from object
  __class__
the object's class
Method Details [hide private]

__init__(self)
(Constructor)

source code 

This constructor should always be called with keyword arguments. Arguments are:

*group* should be None; reserved for future extension when a ThreadGroup class is implemented.

*target* is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

*name* is the thread name. By default, a unique name is constructed of the form "Thread-N" where N is a small decimal number.

*args* is the argument tuple for the target invocation. Defaults to ().

*kwargs* is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

Overrides: object.__init__
(inherited documentation)

run(self)

source code 

Preloads game data.

Keeps releasing and acquiring lock, runs until lock can't be acquired.

Overrides: threading.Thread.run