# HG changeset patch
# User sirebral
# Date 1256757894 18000
# Node ID 217fb049bd007a953b15e13dd6332a475128d91e
# Parent 0f18d16f3fe7f76e88020866e9a9b7e48e61abe1
Traipse Alpha 'OpenRPG' {091028-00}
Traipse is a distribution of OpenRPG that is designed to be easy to setup and go.
Traipse also makes it easy for developers to work on code without fear of
sacrifice. 'Ornery-Orc' continues the trend of 'Grumpy' and adds fixes to the
code. 'Ornery-Orc's main goal is to offer more advanced features and enhance the
productivity of the user.
Update Summary:
Adds Bookmarks (Alpha) with cool Smiley Star and Plus Symbol images!
Changes made to the map for increased portability. SnowDog has changes planned in
Core, though.
Added an initial push to the BCG. Not much to see, just shows off how it is
re-writing Main code.
Fix to remote admin commands
Minor fix to texted based server, works in /System/ folder
Some Core changes to gametree to correctly disply Pretty Print, thanks David!
Fix to Splitter Nodes not being created.
Added images to Plugin Control panel for Autostart feature
Fix to massive amounts of images loading; from Core
fix to gsclient so with_statement imports
Added 'boot' command to remote admin
Prep work in Pass tool for remote admin rankings and different passwords, ei,
Server, Admin, Moderator, etc.
Remote Admin Commands more organized, more prep work.
Added Confirmation window for sent nodes.
Minor changes to allow for portability to an OpenSUSE linux OS (hopefully without
breaking)
{091028}
00:
Made changes to gametree to start working with Element Tree, mostly from Core
Minor changes to Map to start working with Element Tree, from Core
Preliminary changes to map efficiency, from FlexiRPG
Miniatures Layer pop up box allows users to turn off Mini labels, from FlexiRPG
Changes to main.py to start working with Element Tree
diff -r 0f18d16f3fe7 -r 217fb049bd00 orpg/chat/chatwnd.py
--- a/orpg/chat/chatwnd.py Mon Oct 12 23:24:10 2009 -0500
+++ b/orpg/chat/chatwnd.py Wed Oct 28 14:24:54 2009 -0500
@@ -65,14 +65,14 @@
import cStringIO # for reading inline imagedata as a stream
from HTMLParser import HTMLParser
import chat_util
-import traceback
-from wx.lib.expando import EVT_ETC_LAYOUT_NEEDED
-
-from orpg.tools.validate import validate
-from orpg.tools.orpg_settings import settings
-from orpg.orpgCore import component
-from orpg.tools.orpg_log import logger
-from orpg.tools.decorators import debugging
+import traceback
+from wx.lib.expando import EVT_ETC_LAYOUT_NEEDED
+
+from orpg.tools.validate import validate
+from orpg.tools.orpg_settings import settings
+from orpg.orpgCore import component
+from orpg.tools.orpg_log import logger
+from orpg.tools.decorators import debugging
NEWCHAT = False
try:
@@ -84,29 +84,29 @@
# Global parser for stripping HTML tags:
# The 'tag stripping' is implicit, because this parser echoes every
# type of html data *except* the tags.
-class HTMLStripper(HTMLParser):
+class HTMLStripper(HTMLParser):
@debugging
def __init__(self):
self.accum = ""
- self.special_tags = ['hr', 'br', 'img']
+ self.special_tags = ['hr', 'br', 'img']
@debugging
def handle_data(self, data): # quote cdata literally
- self.accum += data
+ self.accum += data
@debugging
def handle_entityref(self, name): # entities must be preserved exactly
- self.accum += "&" + name + ";"
+ self.accum += "&" + name + ";"
@debugging
def handle_starttag(self, tag, attrs):
if tag in self.special_tags:
self.accum += '<' + tag
for attrib in attrs: self.accum += ' ' + attrib[0] + '="' + attrib[1] + '"'
- self.accum += '>'
+ self.accum += '>'
@debugging
def handle_charref(self, name): # charrefs too
self.accum += "" + name + ";"
htmlstripper = HTMLStripper()
-# utility function; see Post().
+# utility function; see Post().
@debugging
def strip_html(string):
"Return string tripped of html tags."
@@ -114,7 +114,7 @@
htmlstripper.accum = ""
htmlstripper.feed(string)
htmlstripper.close()
- return htmlstripper.accum
+ return htmlstripper.accum
@debugging
def log( settings, c, text ):
@@ -150,7 +150,7 @@
# !id :
@debugging
def __init__(self, parent, id):
- wx.html.HtmlWindow.__init__(self, parent, id,
+ wx.html.HtmlWindow.__init__(self, parent, id,
style=wx.SUNKEN_BORDER|wx.html.HW_SCROLLBAR_AUTO|wx.NO_FULL_REPAINT_ON_RESIZE)
self.parent = parent
self.build_menu()
@@ -176,11 +176,11 @@
self.menu.AppendItem(item)
@debugging
- def OnM_EditCopy(self, evt):
- wx.TheClipboard.UsePrimarySelection(False)
- wx.TheClipboard.Open()
- wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
- wx.TheClipboard.Close()
+ def OnM_EditCopy(self, evt):
+ wx.TheClipboard.UsePrimarySelection(False)
+ wx.TheClipboard.Open()
+ wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
+ wx.TheClipboard.Close()
@debugging
def scroll_down(self):
@@ -233,7 +233,7 @@
Returns current font settings in a (fontname, fontsize) tuple."""
self.SetFonts(fontname, "", self.CalculateAllFonts(int(fontsize)))
return (self.GetFont().GetFaceName(), self.GetFont().GetPointSize())
-
+
# class chat_html_window - end
if NEWCHAT:
class ChatHtmlWindow(wx.webview.WebView):
@@ -266,8 +266,8 @@
@debugging
def SetDefaultFontAndSize(self, fontname, fontsize):
- self.__font = wx.Font(int(fontsize),
- wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL,
+ self.__font = wx.Font(int(fontsize),
+ wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL,
wx.FONTWEIGHT_NORMAL, faceName=fontname)
try: self.SetPageSource(self.Header() + self.StripHeader())
except Exception, e: print e
@@ -290,10 +290,10 @@
wx.CallAfter(self.parent.set_chat_text_focus, None)
@debugging
- def OnM_EditCopy(self, evt):
- wx.TheClipboard.UsePrimarySelection(False)
- wx.TheClipboard.Open()
- wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
+ def OnM_EditCopy(self, evt):
+ wx.TheClipboard.UsePrimarySelection(False)
+ wx.TheClipboard.Open()
+ wx.TheClipboard.SetData(wx.TextDataObject(self.SelectionToText()))
wx.TheClipboard.Close()
#Cutom Methods
@@ -353,10 +353,10 @@
# OnPageChanged(self, event)
# set_default_font(self, font, fontsize)
-class chat_notebook(orpgTabberWnd):
+class chat_notebook(orpgTabberWnd):
@debugging
def __init__(self, parent, size):
- orpgTabberWnd.__init__(self, parent, True, size=size,
+ orpgTabberWnd.__init__(self, parent, True, size=size,
style=FNB.FNB_DROPDOWN_TABS_LIST|FNB.FNB_NO_NAV_BUTTONS|FNB.FNB_MOUSE_MIDDLE_CLOSES_TABS)
self.settings = component.get("settings")
self.whisper_tabs = []
@@ -385,7 +385,7 @@
if self.settings.get_setting("GMWhisperTab") == '1':
self.create_gm_tab()
self.SetSelection(0)
-
+
@debugging
def get_tab_index(self, chatpanel):
"Return the index of a chatpanel in the wxNotebook."
@@ -393,7 +393,7 @@
for i in xrange(self.GetPageCount()):
if (self.GetPage(i) == chatpanel):
return i
-
+
@debugging
def create_gm_tab(self):
if self.GMChatPanel == None:
@@ -401,7 +401,7 @@
self.AddPage(self.GMChatPanel, "GM", False)
self.SetPageImage(self.GetPageCount()-1, 1)
self.GMChatPanel.chatwnd.SetDefaultFontAndSize(self.font, self.fontsize)
-
+
@debugging
def create_whisper_tab(self, playerid):
"Add a new chatpanel directly connected to integer 'playerid' via whispering."
@@ -414,7 +414,7 @@
self.AliasLib = component.get('alias')
wx.CallAfter(self.AliasLib.RefreshAliases)
return private_tab
-
+
@debugging
def create_group_tab(self, group_name):
"Add a new chatpanel directly connected to integer 'playerid' via whispering."
@@ -426,7 +426,7 @@
self.AliasLib = component.get('alias')
wx.CallAfter(self.AliasLib.RefreshAliases)
return private_tab
-
+
@debugging
def create_null_tab(self, tab_name):
"Add a new chatpanel directly connected to integer 'playerid' via whispering."
@@ -438,7 +438,7 @@
self.AliasLib = component.get('alias')
wx.CallAfter(self.AliasLib.RefreshAliases)
return private_tab
-
+
@debugging
def onCloseTab(self, evt):
try: tabid = evt.GetSelection()
@@ -467,16 +467,16 @@
if panel in self.whisper_tabs: self.whisper_tabs.remove(panel)
elif panel in self.group_tabs: self.group_tabs.remove(panel)
elif panel in self.null_tabs: self.null_tabs.remove(panel)
-
+
@debugging
def newMsg(self, tabid):
if tabid != self.GetSelection(): self.SetPageImage(tabid, 0)
-
+
@debugging
def onPageChanging(self, event):
"""When private chattabs are selected, set the bitmap back to 'normal'."""
event.Skip()
-
+
@debugging
def onPageChanged(self, event):
"""When private chattabs are selected, set the bitmap back to 'normal'."""
@@ -485,7 +485,7 @@
page = self.GetPage(selected_idx)
#wx.CallAfter(page.set_chat_text_focus, 0)
event.Skip()
-
+
"""
This class defines and builds the Chat Frame for OpenRPG
@@ -512,11 +512,11 @@
ParseNodes(self,s)
get_sha_checksum(self)
get_color(self)
-
+
"""
class chat_panel(wx.Panel):
-
+
"""
This is the initialization subroutine
@@ -524,13 +524,13 @@
!parent : parent that defines the chatframe
!id :
!openrpg :
- !sendtarget: who gets outbound messages: either 'all' or a playerid
- """
-
+ !sendtarget: who gets outbound messages: either 'all' or a playerid
+ """
+
@debugging
def __init__(self, parent, id, tab_type, sendtarget):
- wx.Panel.__init__(self, parent, id)
- logger._set_log_to_console(False)
+ wx.Panel.__init__(self, parent, id)
+ logger._set_log_to_console(False)
self.session = component.get('session')
self.settings = component.get('settings')
self.activeplugins = component.get('plugins')
@@ -562,8 +562,8 @@
self.advancedFilter = False
self.lastSend = 0 # this is used to help implement the player typing indicator
self.lastPress = 0 # this is used to help implement the player typing indicator
- self.Bind(wx.EVT_SIZE, self.OnSize)
- self.Bind(EVT_ETC_LAYOUT_NEEDED, self.OnSize) #require to keep text at bottom of chat when text entry expands --SD
+ self.Bind(wx.EVT_SIZE, self.OnSize)
+ self.Bind(EVT_ETC_LAYOUT_NEEDED, self.OnSize) #require to keep text at bottom of chat when text entry expands --SD
self.build_ctrls()
StartupFont = self.settings.get_setting("defaultfont")
StartupFontSize = self.settings.get_setting("defaultfontsize")
@@ -572,11 +572,11 @@
except: pass
self.font = self.chatwnd.GetFont().GetFaceName()
self.fontsize = self.chatwnd.GetFont().GetPointSize()
- self.scroll_down()
-
+ self.scroll_down()
+
@debugging
def set_default_font(self, fontname=None, fontsize=None):
- """Set all chatpanels to new default fontname/fontsize.
+ """Set all chatpanels to new default fontname/fontsize.
Returns current font settings in a (fontname, fontsize) tuple."""
if (fontname is not None): newfont = fontname
else: newfont = self.font
@@ -587,10 +587,10 @@
self.font = newfont
self.fontsize = newfontsize
return (self.font, self.fontsize)
-
+
@debugging
def build_menu(self):
- top_frame = component.get('frame')
+ top_frame = component.get('frame')
menu = wx.Menu()
item = wx.MenuItem(menu, wx.ID_ANY, "&Background color", "Background color")
top_frame.Bind(wx.EVT_MENU, self.OnMB_BackgroundColor, item)
@@ -625,7 +625,7 @@
tabmenu = wx.Menu()
toolmenu = wx.Menu()
item = wx.MenuItem(wndmenu, wx.ID_ANY, "Show Images", "Show Images", wx.ITEM_CHECK)
- top_frame.Bind(wx.EVT_MENU, self.OnMB_ShowImages, item)
+ top_frame.Bind(wx.EVT_MENU, self.OnMB_ShowImages, item)
wndmenu.AppendItem(item)
if self.settings.get_setting("Show_Images_In_Chat") == '1': item.Check(True)
@@ -676,57 +676,57 @@
toolmenu.AppendItem(item)
if self.settings.get_setting("AliasTool_On") == '1': item.Check(True)
settingmenu.AppendMenu(wx.ID_ANY, 'Chat Tool Bars', toolmenu)
- menu.AppendMenu(wx.ID_ANY, 'Chat Settings', settingmenu)
+ menu.AppendMenu(wx.ID_ANY, 'Chat Settings', settingmenu)
top_frame.mainmenu.Insert(2, menu, '&Chat')
- ## Settings Menu Events
+ ## Settings Menu Events
@debugging
def OnMB_ShowImages(self, event):
if event.IsChecked(): self.settings.set_setting("Show_Images_In_Chat", '1')
else: self.settings.set_setting("Show_Images_In_Chat", '0')
-
+
@debugging
def OnMB_StripHTML(self, event):
if event.IsChecked(): self.settings.set_setting("Sstriphtml", '1')
else: self.settings.set_setting("striphtml", '0')
-
+
@debugging
def OnMB_ChatTimeIndex(self, event):
if event.IsChecked(): self.settings.set_setting("Chat_Time_Indexing", '1')
else: self.settings.set_setting("Chat_Time_Indexing", '0')
-
+
@debugging
def OnMB_ChatAutoComplete(self, event):
if event.IsChecked(): self.settings.set_setting("SuppressChatAutoComplete", '0')
else: self.settings.set_setting("SuppressChatAutoComplete", '1')
-
+
@debugging
def OnMB_ShowIDinChat(self, event):
if event.IsChecked(): self.settings.set_setting("ShowIDInChat", '1')
else: self.settings.set_setting("ShowIDInChat", '0')
-
+
@debugging
def OnMB_LogTimeIndex(self, event):
if event.IsChecked(): self.settings.set_setting("TimeStampGameLog", '1')
else: self.settings.set_setting("TimeStampGameLog", '0')
-
+
@debugging
def OnMB_TabbedWhispers(self, event):
if event.IsChecked(): self.settings.set_setting("tabbedwhispers", '1')
else: self.settings.set_setting("tabbedwhispers", '0')
-
+
@debugging
def OnMB_GMTab(self, event):
if event.IsChecked():
self.settings.set_setting("GMWhisperTab", '1')
self.parent.create_gm_tab()
else: self.settings.set_setting("GMWhisperTab", '0')
-
+
@debugging
def OnMB_GroupWhisperTabs(self, event):
if event.IsChecked(): self.settings.set_setting("GroupWhisperTab", '1')
else: self.settings.set_setting("GroupWhisperTab", '0')
-
+
@debugging
def OnMB_DiceBar(self, event):
act = '0'
@@ -740,7 +740,7 @@
for panel in self.parent.whisper_tabs: panel.toggle_dice(act)
for panel in self.parent.group_tabs: panel.toggle_dice(act)
for panel in self.parent.null_tabs: panel.toggle_dice(act)
-
+
@debugging
def OnMB_FormatButtons(self, event):
act = '0'
@@ -755,7 +755,7 @@
for panel in self.parent.whisper_tabs: panel.toggle_formating(act)
for panel in self.parent.group_tabs: panel.toggle_formating(act)
for panel in self.parent.null_tabs: panel.toggle_formating(act)
-
+
@debugging
def OnMB_AliasTool(self, event):
act = '0'
@@ -769,7 +769,7 @@
for panel in self.parent.whisper_tabs: panel.toggle_alias(act)
for panel in self.parent.group_tabs: panel.toggle_alias(act)
for panel in self.parent.null_tabs:panel.toggle_alias(act)
-
+
@debugging
def OnMB_BackgroundColor(self, event):
top_frame = component.get('frame')
@@ -791,7 +791,7 @@
top_frame.players.SetForegroundColour('black')
top_frame.players.Refresh()
self.chatwnd.scroll_down()
-
+
@debugging
def OnMB_TextColor(self, event):
top_frame = component.get('frame')
@@ -813,7 +813,7 @@
top_frame.players.SetForegroundColour('black')
top_frame.players.Refresh()
self.chatwnd.scroll_down()
-
+
@debugging
def get_hot_keys(self):
# dummy menus for hotkeys
@@ -822,7 +822,7 @@
entries.append((wx.ACCEL_CTRL, ord('H'), self.setChatFocusMenu.GetId()))
#entries.append((wx.ACCEL_CTRL, wx.WXK_TAB, SWAP_TABS))
return entries
-
+
@debugging
def forward_tabs(self, evt):
self.parent.AdvanceSelection()
@@ -832,18 +832,18 @@
# This subroutine builds the controls for the chat frame
#
- # !self : instance of self
+ # !self : instance of self
@debugging
def build_ctrls(self):
self.chatwnd = chat_html_window(self,-1)
self.set_colors()
wx.CallAfter(self.chatwnd.SetPage, self.chatwnd.Header())
if (self.sendtarget == "all"):
- wx.CallAfter(self.Post, self.colorize(self.syscolor,
+ wx.CallAfter(self.Post, self.colorize(self.syscolor,
"Welcome to OpenRPG version " + self.version + "... "))
#self.chat_cmds.on_help()
- self.chattxt = orpg.tools.predTextCtrl.predTextCtrl(self, -1, "",
- style=wx.TE_PROCESS_ENTER |wx.TE_PROCESS_TAB|wx.TE_LINEWRAP,
+ self.chattxt = orpg.tools.predTextCtrl.predTextCtrl(self, -1, "",
+ style=wx.TE_PROCESS_ENTER |wx.TE_PROCESS_TAB|wx.TE_LINEWRAP,
keyHook = self.myKeyHook, validator=None )
self.build_bar()
self.basesizer = wx.BoxSizer(wx.VERTICAL)
@@ -880,7 +880,7 @@
self.chattxt.Bind(wx.EVT_CHAR, self.chattxt.OnChar)
self.chattxt.Bind(wx.EVT_TEXT_COPY, self.chatwnd.OnM_EditCopy)
# def build_ctrls - end
-
+
@debugging
def build_bar(self):
self.toolbar_sizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -896,19 +896,19 @@
self.toolbar_sizer.Add(self.scroll_lock,0,wx.EXPAND)
self.build_formating()
self.build_colorbutton()
-
+
@debugging
def build_scroll(self):
self.scroll_lock = wx.Button( self, wx.ID_ANY, "Scroll ON",size= wx.Size(80,25))
-
+
@debugging
def build_alias(self):
self.aliasList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultAliasName])
- self.aliasButton = createMaskedButton( self, dir_struct["icon"] + 'player.gif',
+ self.aliasButton = createMaskedButton( self, dir_struct["icon"] + 'player.gif',
'Refresh list of aliases from Game Tree', wx.ID_ANY, '#bdbdbd' )
self.aliasList.SetSelection(0)
self.filterList = wx.Choice(self, wx.ID_ANY, size=(100, 25), choices=[self.defaultFilterName])
- self.filterButton = createMaskedButton( self, dir_struct["icon"] + 'add_filter.gif',
+ self.filterButton = createMaskedButton( self, dir_struct["icon"] + 'add_filter.gif',
'Refresh list of filters from Game Tree', wx.ID_ANY, '#bdbdbd' )
self.filterList.SetSelection(0)
self.toolbar_sizer.Add( self.aliasButton, 0, wx.EXPAND )
@@ -917,7 +917,7 @@
self.toolbar_sizer.Add( self.filterList,0,wx.EXPAND)
if self.settings.get_setting('AliasTool_On') == '0': self.toggle_alias('0')
else: self.toggle_alias('1')
-
+
@debugging
def toggle_alias(self, act):
if act == '0':
@@ -932,11 +932,11 @@
self.toolbar_sizer.Show(self.aliasButton, True)
self.toolbar_sizer.Show(self.filterButton, True)
self.toolbar_sizer.Layout()
-
+
@debugging
def build_text(self):
self.textpop_lock = createMaskedButton(self, dir_struct["icon"]+'note.gif', 'Open Text View Of Chat Session', wx.ID_ANY, '#bdbdbd')
-
+
@debugging
def build_dice(self):
self.numDieText = wx.TextCtrl( self, wx.ID_ANY, "1", size= wx.Size(25, 25), validator=orpg.tools.inputValidator.MathOnlyValidator() )
@@ -959,7 +959,7 @@
self.toolbar_sizer.Add( self.dieModText, 0, wx.ALIGN_CENTER, 5 )
if self.settings.get_setting('DiceButtons_On') == '0': self.toggle_dice('0')
else: self.toggle_dice('1')
-
+
@debugging
def toggle_dice(self, act):
if act == '0':
@@ -984,21 +984,21 @@
self.toolbar_sizer.Show(self.d100Button, True)
self.toolbar_sizer.Show(self.dieModText, True)
self.toolbar_sizer.Layout()
-
+
@debugging
def build_formating(self):
- self.boldButton = createMaskedButton( self, dir_struct["icon"]+'bold.gif',
+ self.boldButton = createMaskedButton( self, dir_struct["icon"]+'bold.gif',
'Make the selected text Bold', wx.ID_ANY, '#bdbdbd')
- self.italicButton = createMaskedButton( self, dir_struct["icon"]+'italic.gif',
+ self.italicButton = createMaskedButton( self, dir_struct["icon"]+'italic.gif',
'Italicize the selected text', wx.ID_ANY, '#bdbdbd' )
- self.underlineButton = createMaskedButton( self, dir_struct["icon"]+'underlined.gif',
+ self.underlineButton = createMaskedButton( self, dir_struct["icon"]+'underlined.gif',
'Underline the selected text', wx.ID_ANY, '#bdbdbd' )
self.toolbar_sizer.Add( self.boldButton, 0, wx.EXPAND )
self.toolbar_sizer.Add( self.italicButton, 0, wx.EXPAND )
self.toolbar_sizer.Add( self.underlineButton, 0, wx.EXPAND )
if self.settings.get_setting('FormattingButtons_On') == '0': self.toggle_formating('0')
else: self.toggle_formating('1')
-
+
@debugging
def toggle_formating(self, act):
if act == '0':
@@ -1012,20 +1012,20 @@
self.toolbar_sizer.Show(self.underlineButton, True)
self.toolbar_sizer.Layout()
- # Heroman - Ideally, we would use static labels...
+ # Heroman - Ideally, we would use static labels...
@debugging
def build_colorbutton(self):
- self.color_button = createMaskedButton(self, dir_struct["icon"]+'textcolor.gif',
- 'Text Color', wx.ID_ANY, '#bdbdbd',
- wx.BITMAP_TYPE_GIF)
+ self.color_button = createMaskedButton(self, dir_struct["icon"]+'textcolor.gif',
+ 'Text Color', wx.ID_ANY, '#bdbdbd',
+ wx.BITMAP_TYPE_GIF)
- self.saveButton = createMaskedButton(self, dir_struct["icon"]+'save.bmp',
- 'Save the chatbuffer', wx.ID_ANY,
- '#c0c0c0', wx.BITMAP_TYPE_BMP )
+ self.saveButton = createMaskedButton(self, dir_struct["icon"]+'save.bmp',
+ 'Save the chatbuffer', wx.ID_ANY,
+ '#c0c0c0', wx.BITMAP_TYPE_BMP )
self.color_button.SetBackgroundColour(self.settings.get_setting('mytextcolor'))
self.toolbar_sizer.Add(self.color_button, 0, wx.EXPAND)
- self.toolbar_sizer.Add(self.saveButton, 0, wx.EXPAND)
-
+ self.toolbar_sizer.Add(self.saveButton, 0, wx.EXPAND)
+
@debugging
def OnMotion(self, evt):
contain = self.chatwnd.GetInternalRepresentation()
@@ -1051,7 +1051,7 @@
#
# self: duh
- # event: raw KeyEvent from OnChar()
+ # event: raw KeyEvent from OnChar()
@debugging
def myKeyHook(self, event):
if self.session.get_status() == MPLAY_CONNECTED: # only do if we're connected
@@ -1071,7 +1071,7 @@
# This subroutine gets called once a second by the typing Timer
# It checks if we need to send a not_typing message
#
- # self: duh
+ # self: duh
@debugging
def typingTimerFunc(self, event):
#following added by mDuo13
@@ -1093,8 +1093,8 @@
# This subroutine actually takes care of sending the messages for typing/not_typing events
#
# self: duh
- # typing: boolean
-
+ # typing: boolean
+
@debugging
def sendTyping(self, typing):
if typing:
@@ -1113,7 +1113,7 @@
# This subroutine sets the colors of the chat based on the settings in the
# self instance.
#
- # !self : instance of self
+ # !self : instance of self
@debugging
def set_colors(self):
# chat window backround color
@@ -1135,19 +1135,19 @@
# This subroutine will insert text into the chat window
#
# !self : instance of self
- # !txt : text to be inserted into the chat window
+ # !txt : text to be inserted into the chat window
@debugging
def set_chat_text(self, txt):
self.chattxt.SetValue(txt)
self.chattxt.SetFocus()
self.chattxt.SetInsertionPointEnd()
# def set_chat_text - end
-
+
@debugging
def get_chat_text(self):
return self.chattxt.GetValue()
- # This subroutine sets the focus to the chat window
+ # This subroutine sets the focus to the chat window
@debugging
def set_chat_text_focus(self, event):
wx.CallAfter(self.chattxt.SetFocus)
@@ -1160,7 +1160,7 @@
# !event :
#
# Note: self.chattxt now handles it's own Key events. It does, however still
- # call it's parent's (self) OnChar to handle "default" behavior.
+ # call it's parent's (self) OnChar to handle "default" behavior.
@debugging
def OnChar(self, event):
s = self.chattxt.GetValue()
@@ -1174,18 +1174,18 @@
if self.session.get_status() == MPLAY_CONNECTED: # only do if we're connected
self.sendTyping(0) # Send a "not_typing" event on enter key press
macroText=""
- recycle_bin = {wx.WXK_F1: 'event.GetKeyCode() == wx.WXK_F1', wx.WXK_F2: 'event.GetKeyCode() == wx.WXK_F2',
- wx.WXK_F3: 'event.GetKeyCode() == wx.WXK_F3', wx.WXK_F4: 'event.GetKeyCode() == wx.WXK_F4',
- wx.WXK_F5: 'event.GetKeyCode() == wx.WXK_F5', wx.WXK_F6: 'event.GetKeyCode() == wx.WXK_F6',
- wx.WXK_F7: 'event.GetKeyCode() == wx.WXK_F7', wx.WXK_F8: 'event.GetKeyCode() == wx.WXK_F8',
- wx.WXK_F9: 'event.GetKeyCode() == wx.WXK_F9', wx.WXK_F10: 'event.GetKeyCode() == wx.WXK_F10',
- wx.WXK_F11: 'event.GetKeyCode() == wx.WXK_F11', wx.WXK_F12: 'event.GetKeyCode() == wx.WXK_F12'}
-
- bin_event = event.GetKeyCode()
- if recycle_bin.has_key(bin_event):
- logger.debug(lambda bin_event: recycle_bin[bin_event])
- macroText = self.settings.get_setting(recycle_bin[bin_event][29:])
- recycle_bin = {}; del bin_event
+ recycle_bin = {wx.WXK_F1: 'event.GetKeyCode() == wx.WXK_F1', wx.WXK_F2: 'event.GetKeyCode() == wx.WXK_F2',
+ wx.WXK_F3: 'event.GetKeyCode() == wx.WXK_F3', wx.WXK_F4: 'event.GetKeyCode() == wx.WXK_F4',
+ wx.WXK_F5: 'event.GetKeyCode() == wx.WXK_F5', wx.WXK_F6: 'event.GetKeyCode() == wx.WXK_F6',
+ wx.WXK_F7: 'event.GetKeyCode() == wx.WXK_F7', wx.WXK_F8: 'event.GetKeyCode() == wx.WXK_F8',
+ wx.WXK_F9: 'event.GetKeyCode() == wx.WXK_F9', wx.WXK_F10: 'event.GetKeyCode() == wx.WXK_F10',
+ wx.WXK_F11: 'event.GetKeyCode() == wx.WXK_F11', wx.WXK_F12: 'event.GetKeyCode() == wx.WXK_F12'}
+
+ bin_event = event.GetKeyCode()
+ if recycle_bin.has_key(bin_event):
+ logger.debug(lambda bin_event: recycle_bin[bin_event])
+ macroText = self.settings.get_setting(recycle_bin[bin_event][29:])
+ recycle_bin = {}; del bin_event
# Append to the existing typed text as needed and make sure the status doesn't change back.
if len(macroText):
@@ -1301,7 +1301,7 @@
else: event.Skip()
logger.debug("Exit chat_panel->OnChar(self, event)")
# def OnChar - end
-
+
@debugging
def onDieRoll(self, evt):
"""Roll the dice based on the button pressed and the die modifiers entered, if any."""
@@ -1322,7 +1322,7 @@
# FileDialog.
#
# !self : instance of self
- # !evt :
+ # !evt :
@debugging
def on_chat_save(self, evt):
f = wx.FileDialog(self,"Save Chat Buffer",".","","HTM* (*.htm*)|*.htm*|HTML (*.html)|*.html|HTM (*.htm)|*.htm",wx.SAVE)
@@ -1333,19 +1333,19 @@
f.Destroy()
os.chdir(dir_struct["home"])
# def on_chat_save - end
-
+
@debugging
def ResetPage(self):
self.set_colors()
buffertext = self.chatwnd.Header() + "\n"
- buffertext += chat_util.strip_body_tags(self.chatwnd.StripHeader()).replace("
",
- "
").replace('