#!/usr/bin/env python
# -*- coding: UTF-8 -*-

#发文并上传剪切板图片

sys.path.insert( 0, '.' )
wd = GetWorkDir()
sys.path.extend( [ wd + 'lib\\site-packages', wd + 'lib\\site-packages\\PIL'] )

from postmilti import *
from img_save import *

ID = GetSessionID()
SendString( ID, '\x10' ) #^p
SendString( ID, r'翠花，上图片！' )
SendString( ID, '\nu\n' )
dataEvents[ID].wait()
url = GetText(ID, 1).strip()
SendString( ID, '\n\x17' ) #^w
dataEvents[ID].wait()
SendString( ID, 't\n' ) #t for title

#url = r'http://www.newsmth.net/bbsupload.php?sid=xxxxxxxxx'

if saveimg():
	print postfile(url, r'copy.jpg')
