Jump to content

[Python] Function global for block words


VegaS™
 Share

Recommended Posts

import dbg, app, chat
		szText = self.GetText()
		#szText_ = self.inputValue.GetText()  ## your input value
		
		try:
			szGetFile = app.OpenTextFile("locale/en/block_words_python.txt")
			count_words = app.GetTextFileLineCount(szGetFile)
		except IOError:
			dbg.LogBox("Error: Loading words !")
			app.Abort()

		for vegas in xrange(count_words):
			lineText = app.GetTextFileLine(szGetFile, vegas)
			szGetTextFromFile = str(lineText).split("\t")
			if len(szGetTextFromFile) == 0 or not szGetTextFromFile[0]:
				continue	
			if szText == szGetTextFromFile[0]:
				chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Blocked words were introduced!")
				return
			#if szText == szGetTextFromFile[0] and szText.find("b") != -1:
				#chat.AppendChat(chat.CHAT_TYPE_INFO, "[SYSTEM] Check Function Test 1!")
				#return
			#iText = szGetTextFromFile[0]
			#if text and iText.find(" ") != -1:
			#if szGetTextFromFile[0] and text.find("a"):
			#if iText.strip().split(" ")[1] == text[-1:]:
			#test = self.GetText()
			#if szGetTextFromFile[0]:
				#if test.find(" "):
				#szText = szText.replace(" ", "____")
					#chat.AppendChat(chat.CHAT_TYPE_INFO, "[CHAT] Check Function Test 2!")
					#return
			#if szText.find("vegas") != -1:
				#iText = str(iText).replace(" ", "pythonX")

locale/en/block_words_python.txt

vegas0
vegas1
vegas2
vegas3
vegas4
vegas5
vegas6
vegas7
vegas8
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...