Peach :: Publishers :: file :: FileWriterLauncherGui :: Class FileWriterLauncherGui
[hide private]

Class FileWriterLauncherGui

source code


Writes a file to disk and then launches a program. After some defined amount of time we will try and close the GUI application by sending WM_CLOSE than kill it.

To use, first use this publisher like the FileWriter stream publisher. Close, than call a program (or two).

Instance Methods [hide private]
 
__init__(self, filename, windowname) source code
string
getFilename(self)
Get current filename.
source code
 
setFilename(self, filename)
Set new filename.
source code
 
start(self)
Change state such that send/receave will work.
source code
 
connect(self) source code
 
stop(self)
Change state such that send/receave will not work.
source code
 
mkdir(self) source code
 
close(self)
Close current stream/connection.
source code
 
send(self, data)
Publish some data
source code
string
receive(self, size=None)
Receive some data.
source code
string
call(self, method, args)
Launch program to consume file
source code
 
closeApp(self, title)
Close Application by window title
source code

Inherited from publisher.Publisher: accept, property

Static Methods [hide private]
 
enumCallback(hwnd, windowName)
Will get called by win32gui.EnumWindows, once for each top level application window.
source code
Class Variables [hide private]
  _filename = None
  _fd = None
  _state = 0
Method Details [hide private]

__init__(self, filename, windowname)
(Constructor)

source code 
Parameters:
  • filename (string) - Filename to write to
  • windowname (string) - Partial window name to locate and kill

getFilename(self)

source code 

Get current filename.

Returns: string
current filename

setFilename(self, filename)

source code 

Set new filename.

Parameters:
  • filename (string) - Filename to set

start(self)

source code 

Change state such that send/receave will work. For Tcp this could be connecting to a remote host

Overrides: publisher.Publisher.start
(inherited documentation)

stop(self)

source code 

Change state such that send/receave will not work. For Tcp this could be closing a connection, for a file it might be closing the file handle.

Overrides: publisher.Publisher.stop
(inherited documentation)

close(self)

source code 

Close current stream/connection.

Overrides: publisher.Publisher.close
(inherited documentation)

send(self, data)

source code 

Publish some data

Parameters:
  • data - Data to publish
Overrides: publisher.Publisher.send
(inherited documentation)

receive(self, size=None)

source code 

Receive some data.

Parameters:
  • size - Number of bytes to return
Returns: string
data received
Overrides: publisher.Publisher.receive
(inherited documentation)

call(self, method, args)

source code 

Launch program to consume file

Parameters:
  • method (string) - Command to execute
  • args (array of objects) - Arguments to pass
Returns: string
data returned (if any)
Overrides: publisher.Publisher.call