コード例 #1
0
 def paste_text_handler(self, event):
     do = wx.TextDataObject()
     wx.TheClipboard.Open()
     success = wx.TheClipboard.GetData(do)
     wx.TheClipboard.Close()
     if success:
         insertionpoint = self.console.GetInsertionPoint()
         lastline, lastpos, startcol, endcol = self.get_last_line()
         cliptext = universal_newlines(do.GetText())
         lines = cliptext.replace("\n", "\n\0").split("\0")
         command1 = (lastline[2:startcol] + lines[0].rstrip("\n") +
                     lastline[endcol:])
         self.add_text("\r> " + command1)
         if "\n" in cliptext:
             self.send_command_handler(command1, lines[1:])
         else:
             self.console.SetInsertionPoint(insertionpoint + len(cliptext))
コード例 #2
0
ファイル: log.py プロジェクト: laevar/jupiter
	def __call__(self, msg, fn=None):
		"""
		Log a message.
		
		Optionally use function 'fn' instead of logging.info.
		
		"""
		if fn is None and logging.getLogger(appname).handlers:
			fn = logging.getLogger(appname).info
		if fn:
			for line in universal_newlines(msg).split("\n"):
				fn(line)
		if "wx" in sys.modules:
			from wxaddons import wx
			if wx.GetApp() is not None and \
			   hasattr(wx.GetApp(), "frame") and \
			   hasattr(wx.GetApp().frame, "infoframe"):
				wx.CallAfter(wx.GetApp().frame.infoframe.Log, msg)
コード例 #3
0
    def __str__(self):
        return universal_newlines("""<?xml version="1.0" encoding="UTF-16"?>
%s""" % str(self)).replace("\n", "\r\n").encode("UTF-16-LE")
コード例 #4
0
 def __init__(self, buf=''):
     StringIO.__init__(self, universal_newlines(buf))
コード例 #5
0
ファイル: util_io.py プロジェクト: laevar/jupiter
	def __init__(self, buf=''):
		StringIO.__init__(self, universal_newlines(buf))