Ejemplo n.º 1
0
def set_global_font_path(path):
	try:
		global GLOBAL_FONT_PATH
		assert os.path.isfile(path)
		GLOBAL_FONT_PATH = convert.get_str(path)
	except:
		log.err(traceback.format_exc())
Ejemplo n.º 2
0
	def play(self, path, loop=False):
		self.stop()
		self.loop_count = 0 if loop else 1
		if convert.get_unicode(path).find(">") != -1:
			if share.KEY:
				self.spawn(
					"http://127.0.0.1:%d/req=%s"%(share.PORT, encrypt_path(path))
				)
			else:
				self.spawn(
					convert.get_str(convert.get_unicode(path).replace(">", "/"))
				)
		elif os.path.isfile(path):
			self.spawn(path)
		else:
			raise IOError("%s not exist"%path)
Ejemplo n.º 3
0
 def set_text(self, text):
     self.buf.set_text(convert.get_str(text))
Ejemplo n.º 4
0
def log(pipe, type, *messages):
    pipe.write("%s %s\n" % (
        str(type),
        " ".join(map(lambda s: convert.get_str(s), messages)),
    ))
Ejemplo n.º 5
0
	def set_text(self, text):
		self.buf.set_text(convert.get_str(text))
Ejemplo n.º 6
0
Archivo: log.py Proyecto: pyzzz/mygtk
def log(pipe, type, *messages):
	pipe.write("%s %s\n"%(
		str(type),
		" ".join(map(lambda s: convert.get_str(s), messages)),
	))
Ejemplo n.º 7
0
def encrypt_path(path):
	ext = os.path.splitext(convert.get_unicode(path))[1] or ".none"
	return path.encode("hex")+convert.get_str(ext)
Ejemplo n.º 8
0
	def play(self, path, *args, **argv):
		self.args = self.args[:-1]+(convert.get_str(self.get_id()),)
		StandardPlayer.play(self, path, *args, **argv)
Ejemplo n.º 9
0
def posix_path(path):
	return convert.get_str(convert.get_unicode(path).replace("\\", "/"))