Beispiel #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())
Beispiel #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)
Beispiel #3
0
 def set_text(self, text):
     self.buf.set_text(convert.get_str(text))
Beispiel #4
0
def log(pipe, type, *messages):
    pipe.write("%s %s\n" % (
        str(type),
        " ".join(map(lambda s: convert.get_str(s), messages)),
    ))
Beispiel #5
0
	def set_text(self, text):
		self.buf.set_text(convert.get_str(text))
Beispiel #6
0
def log(pipe, type, *messages):
	pipe.write("%s %s\n"%(
		str(type),
		" ".join(map(lambda s: convert.get_str(s), messages)),
	))
Beispiel #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)
Beispiel #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)
Beispiel #9
0
def posix_path(path):
	return convert.get_str(convert.get_unicode(path).replace("\\", "/"))