當前位置: 首頁>>代碼示例>>Python>>正文


Python Text.__init__方法代碼示例

本文整理匯總了Python中Text.Text.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python Text.__init__方法的具體用法?Python Text.__init__怎麽用?Python Text.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Text.Text的用法示例。


在下文中一共展示了Text.__init__方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Text import Text [as 別名]
# 或者: from Text.Text import __init__ [as 別名]
	def __init__(self, model, visitor, obj=None, config=None):
		self.model = model
		Generic.__init__(self, visitor, obj, config)
		GenericSerial.__init__(self, visitor, obj, config)
		Text.__init__(self, rows=model.rows, cols=model.cols, yres=8, xres=6, goto=model.goto, chars=model.chars, char0=model.char0)
		if obj is None:
			self.port = ''
			self.baud = 19200
			self.command_rate = .0165
			self.layout_timeout = 0
		else:
			self.port = obj.port
			self.baud = obj.baud
			self.command_rate = obj.command_rate
			self.layout_timeout = obj.layout_timeout

		self.command_thread = ThreadedTask(self.command_worker, None, 1)
		self.command_queue = Queue.Queue()
		self.command_time = time.time()
開發者ID:Starlon,項目名稱:LCD4Py,代碼行數:21,代碼來源:DrvCrystalfontz.py

示例2: __init__

# 需要導入模塊: from Text import Text [as 別名]
# 或者: from Text.Text import __init__ [as 別名]
	def __init__(self, darea, rows=4, cols=20, config=None):
		file = open('cfa635_fonts.dat', 'r')
		self.lcd_fonts = pickle.load(file)
		file.close()
		self.ch_data = []
		self.fontP = None
		self.interface = None
		self.current_state = None
		self.previous_state = None
		self.mode_flag = 0
		self.data_latch = None
		self.data_latch_phase = None
		self.debug = False
		self.cursor = {'row':0, 'col':0}
		self.lcd_gc = None
		self.rows = rows
		self.cols = cols
		self.dots = {'x':6, 'y':8} # Resolution in lcd pixels. e.g. 5x7
		self.pixels = {'x':4, 'y':4} # Resolution in crt pixels - scaled
		self.contrast = None
		self.dot_color = None
		self.title = None
		self.window = None
		self.darea = None
		self.w_width = None
		self.w_height = None
		self.disp_type = 0
		self.border = 5
		self.darea = darea
		self.darea.connect('expose-event', self.lcd_expose_event, self)
		self.darea.connect('button-press-event', self.cursor_event)
		self.bg_color = gtk.gdk.color_parse("#78a878")
		self.fg_color = gtk.gdk.color_parse("#113311")
		self.config = config
		Generic.__init__(self, None, config)
		Text.__init__(self, rows=rows, cols=cols, yres=8, xres=6, goto=0, chars=8, char0=0)
開發者ID:Starlon,項目名稱:LCD4Py,代碼行數:38,代碼來源:CFLCD.py

示例3: __init__

# 需要導入模塊: from Text import Text [as 別名]
# 或者: from Text.Text import __init__ [as 別名]
	def __init__ ( self, visitor, obj=None, config=None):
		Generic.__init__(self, visitor, obj, config)
		GenericSerial.__init__(self, visitor, obj, config)
		Text.__init__(self, rows=4, cols=20, yres=8, xres=5, goto=2, chars=8, char0=0)
		if obj == None:
			self.name = 'noname'
			self.port = ''
			self.baud = 19200
			self.layout_timeout = 0 #Default layout timeout. 0 = no transitions. Override at layout level.
			self.layouts = {}
			self.write_rate = .0165
		else:
			self.name = obj.name
			self.port = obj.port
			self.baud = obj.baud
			self.layout_timeout = obj.layout_timeout
			self.layouts = obj.layouts
			self.write_rate = obj.write_rate
		self.app = visitor
		self.debug = visitor.debug
		self.AddFunction("backlight", 0, self.my_backlight)
		self.write_thread = threading.Thread(target=self.write_worker)
		self.write_active = False
		self.write_queue = Queue.Queue()
開發者ID:Starlon,項目名稱:LCD4Py,代碼行數:26,代碼來源:DrvPertelian.py

示例4: __init__

# 需要導入模塊: from Text import Text [as 別名]
# 或者: from Text.Text import __init__ [as 別名]
 def __init__(self, ownerDocument, data):
     Text.__init__(self, ownerDocument, data)
     self.__dict__['__nodeName'] = "#cdata-section"
開發者ID:AngusGeek,項目名稱:org.aspectj,代碼行數:5,代碼來源:CDATASection.py


注:本文中的Text.Text.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。