From: Jarda B. <edh...@us...> - 2005-03-06 22:06:05
|
Update of /cvsroot/gemrb/ie_shell/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1734/plugins Modified Files: __init__.py builtins.py core.py Added Files: raw_strings.py Log Message: Made possible to use !cmd to exec shell command Store untranslated strings as well for TLK Added plugin to print untranslated strings Index: builtins.py =================================================================== RCS file: /cvsroot/gemrb/ie_shell/plugins/builtins.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** builtins.py 2 Mar 2005 20:44:23 -0000 1.1.1.1 --- builtins.py 6 Mar 2005 22:05:49 -0000 1.2 *************** *** 12,16 **** print core.strrefs.strref_list.index(o), o['string'] - # Export resource `name' into file `filename'. If the `name' is not unique # specify resource type with `type' --- 12,15 ---- Index: __init__.py =================================================================== RCS file: /cvsroot/gemrb/ie_shell/plugins/__init__.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** __init__.py 2 Mar 2005 20:44:23 -0000 1.1.1.1 --- __init__.py 6 Mar 2005 22:05:49 -0000 1.2 *************** *** 3,4 **** --- 3,5 ---- from builtins import * from button_frames import * + from raw_strings import * --- NEW FILE: raw_strings.py --- #-*-python-*- #import os.path from plugins import core ################################################### # Print hexa code of characters in given strref, # without conversion def print_raw_str (strref): print core.strrefs.strref_list[strref]['string_raw'] print map (lambda c: c + " (%02x)" %ord (c), core.strrefs.strref_list[strref]['string_raw']) Index: core.py =================================================================== RCS file: /cvsroot/gemrb/ie_shell/plugins/core.py,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** core.py 2 Mar 2005 20:44:23 -0000 1.1.1.1 --- core.py 6 Mar 2005 22:05:49 -0000 1.2 *************** *** 13,20 **** keys = None - global slash_trans slash_trans = string.maketrans ('\\', '/') restype_list = [ --- 13,34 ---- keys = None global slash_trans slash_trans = string.maketrans ('\\', '/') + t_cp1250 = 'áèïéìíòóøúùýÁÈÏÉÌÍÒÓØÚÙÝ' + t_iso8859_2 = 'áèïéìíòóø¹»úùý¾ÁÈÏÉÌÍÒÓØ©«ÚÙÝ®' + + global lang_trans + lang_trans = string.maketrans (t_cp1250, t_iso8859_2) + + def translate_to_iso (s): + return string.translate (s, lang_trans) + + def cond (c, a, b): + if c: return a + else: return b + + def translate_to_ord (s): + return map (lambda c: (cond (ord (c) < 128, c, "\\x%02X" %(ord (c))), s)) restype_list = [ |