Changeset - 9d96506fce9e
[Not reviewed]
0 1 0
HanzZ - 13 years ago 2012-04-10 10:29:18
hanzz.k@gmail.com
show error message when libpurple.dll can't be loaded
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
backends/libpurple/gen_dynamic_purple.py
Show inline comments
 
import sys
 
import os
 

	
 
methods = []
 
# intialize for methods used in libpurple macros
 
methods = ["purple_connection_get_state", "purple_conversation_get_im_data",
 
			"purple_conversation_get_chat_data"]
 
definitions = []
 

	
 
if len(sys.argv) != 2:
 
	print "Usage:", sys.argv[0], "<path_to_libpurple_dir_containing_libpurple_headers>"
 
	sys.exit(1)
 

	
 

	
 
def handle_file(cpp):
 
	global methods
 

	
 
	new_file = ""
 
	f = open(cpp, "r")
 
	for line in f.readlines():
 
		new_line = ""
 
		index = 0
 
		while index < len(line):
 
			new_line += line[index]
 
			if line[index:].startswith("purple_") or line[index:].startswith("wpurple_"):
 
				if line[index:].find("=") != -1 and line[index:].find("=") < line[index:].find("("):
 
					index += 1
 
					continue
 
				if line[index-1] == "_" or line[index:].find("(") == -1:
 
					index += 1
 
					continue
0 comments (0 inline, 0 general)