Пример #1
0
def pasteFromClipboard(mainApp, baseTIG, mode='SIBLING'):
	if baseTIG <> None:
		stringXML = mainApp.selection_get(selection='CLIPBOARD')
		print stringXML
		pasteRoot = xml_man.parseStringXML(stringXML)
		print 'pasteRoot', pasteRoot
		
		rootTIG = tk_app.createNewTagInTree(mainApp, baseTIG, mode, oTag=pasteRoot)
		createChildTIGs(mainApp, rootTIG, level=0)
		
		tk_app.selectAndFocus(rootTIG.id)
Пример #2
0
def unCommentTag(mainApp, commentTIG):
	stringXML = commentTIG.getTag().text
	newTIG = None
	response = 'no'
	try:
		newTag = xml_man.parseStringXML(stringXML)
		newTIG = tk_app.createNewTagInTree(mainApp, commentTIG, 'SIBLING', oTag = newTag)
	except:
		response = tkMessageBox.showwarning("eXMLorer", GL.names['message_uncomment_newtag'], type=tkMessageBox.YESNO)
		if response == 'yes':
			newTIG = tk_app.createNewTagInTree(mainApp, commentTIG, 'SIBLING', text=commentTIG.getTag().text)
	
	if newTIG <> None:
		createChildTIGs(mainApp, newTIG, level=0)
		tk_app.deleteTagInTree(commentTIG.id)
		tk_app.selectAndFocus(newTIG.id)