Exemplo n.º 1
0
def main():
    # copy article to reply
    f = file(log, "w")

    f.write(qterm.toUTF8(qterm.copyArticle(lp), "gbk"))

    f.close()

    qterm.sendString(lp, "r\n")
    for i in range(0, 12):
        qterm.sendString(lp, "")

    # call external editor
    subprocess.call([editor, log])

    # post back
    f = file(log, "r")

    content = ""
    for i in f.readlines():
        content += i

    f.close()

    qterm.sendString(lp, qterm.fromUTF8(content, "gbk"))
    qterm.sendString(lp, "")
Exemplo n.º 2
0
def main():
    # copy article to reply
    f = file(log, "w")

    f.write(qterm.toUTF8(qterm.copyArticle(lp), "gbk"))

    f.close()

    qterm.sendString(lp, "r\n")
    for i in range(0, 12):
        qterm.sendString(lp, "")

    # call external editor
    subprocess.call([editor, log])

    # post back
    f = file(log, "r")

    content = ""
    for i in f.readlines():
        content += i

    f.close()

    qterm.sendString(lp, qterm.fromUTF8(content, "gbk"))
    qterm.sendString(lp, "")
Exemplo n.º 3
0
def down_digest(lp, dir):
	if dir[-1] != '/':
		dir += '/'
	if not os.access(dir, os.F_OK):
		os.makedirs(dir)
	title = get_title_list_ready(lp)
	if not title:
		return
	if title[0] != 1:
		raise 'Not in Digest mode'
	initnum = title[1]
	while True:
		if title[2] != 'Ŀ¼':
			send_char(lp, 'r')
			text = qterm.copyArticle(lp, colorful)
			return_to_list(lp)
			f = open(dir + nameconv(title[1] + sep + 
				strip_digest_title_date_bm(title[3])), 'w')
			f.write(purge_ansi(text))
			f.close()
		else:
			send_char(lp, 'r')
			down_digest(lp, dir + nameconv(title[1] + sep + 
				strip_digest_title_date_bm(title[3])))
			send_char(lp, 'q')
		send_char(lp, 'j')
		title = get_title_list_ready(lp)
		if title[1] == initnum:
			break