| |
Methods defined here:
- AddWord(self, frame, word, example, meaning, syntax)
- This method obtains the data from the form and uses it to add a new word
inside the database associated with the current user.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
word: new word to be included
example: example in which the word is used
meaning: meaning of the word in the user's native language
syntaxis: type of word (verb, preposition...)
- ByeWord(self, frame, word)
- This method obtains the data from the form and uses it to delete an
existing word from the database associated with the current user.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
word: word to be included
- ChangPass(self)
- Frame to change the password associated with the user whose session is
opened.
- ChangePass(self, newpass, frame)
- This method connects to the database "users.db" and changes the user's
password.
- Configure(self)
- Shows a frame with the different variables that can be modified. The
user can modify:
-The background colour.
-If the user wants to activate the automatics mails (they are
desactivated by default). The user can choose the content
of the email (statistics and/or word of the day).
-If the user wants to desactivate the automatics mails.
-The number of options of the game (4,5 or 6)
-If the user wants to restart the game (update the levels to 1).
-If the user wants to import data from an external database.
-If the user wants to open the log file.
-The password
- GoToMenu(self, frame)
- Destroys the current frame and shows the main menu.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- MainMenu(self)
- Shows the main menu
- Play(self, frame, level, wordOrMeaning, wordType)
- Shows the question and the options
Args:
frame: previous frame of the window to be deleted before creating
the new one.
level: level of the words that can be selected for the game. If all
levels can be picked out, then level="all levels".
wordOrMeaning: "Choose meaning" if the options to chose are the
meanings, or "Choose word" if the options to chose are the word
names.
wordType: word type of the words that can be selected for the game.
If all word types can be picked out, then wordType="all".
- __init__(self, loggedUser)
- Once this class is executed, this function is run.
This method creates the window in which the user can play with his/her
content. The properties of the new window are obtained from the
properties file.
The self is defined
- answerPlay(self, frame, answer, word, level, wordOrMeaning, wordType)
- Shows if the player's answer is correct, update the level (+1 if
correct; -1 if wrong. Levels between 1 and 10), adn shows the
information about the correct answer (word name, meaning, example
-if there is-,new level).
Args:
frame: previous frame of the window to be deleted before creating
the new one.
answer: option picked out by the user
word: correct answer
level: level of the words that can be selected for the game. If all
levels can be picked out, then level="all levels".
wordOrMeaning: "Choose meaning" if the options to chose are the
meanings, or "Choose word" if the options to chose are the word
names.
wordType: word type of the words that can be selected for the game.
If all word types can be picked out, then wordType="all".
- areDifferent(self, frame)
- Returns an error if 2 inputs dont match while trying to change the
current user's password.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- automails(self, frame, includeword, includestats, mail, bool)
- This method allows to change the information about the mails. It
connects to the properties file and save the new configuration.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
includeword: boolean. If True, the email will include information
about one of the words in the user's database. This word is
randomly generated.
includestats: boolean. If True, the email will include the
statistics about the game to the user.
mail: name of the recipient.
bool: boolean. If True, the automatic mails are activated. False
otherwise
- changeColour(self, frame)
- This method allows to change the information about the background colour.
It connects to the properties file and save the new configuration.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- changeNoptions(self, frame, value)
- This method allows to change the number of options of the game.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
value: new number of options of the game. It is 4 by default. This
value is stored in the properties file.
- checkIfPlay(self, frame, level, wordOrMeaning, wordType)
- Checks if there are words enough before proceeding to play
Args:
frame: previous frame of the window to be deleted before creating
the new one.
level: level of the words that can be selected for the game. If all
levels can be picked out, then level="all levels".
wordOrMeaning: "Choose meaning" if the options to chose are the
meanings, or "Choose word" if the options to chose are the word
names.
wordType: word type of the words that can be selected for the game.
If all word types can be picked out, then wordType="all".
- consPron(self, frame)
- This method shows the theory associated with the prounuciation of the
consonants.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- createFile(self, frame, orderBy, orderType)
- This method creates a pdf with the words stored in the database. The
details have been obtained from the method showWords() and are
passed as arguments.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
orderBy: indicates the column to choose the order ("date","word",
"level" or "word type")
orderType: select the order type (ascending ,"ASC", or descending,
DESC")
- credits(self)
- This method shows information about the application.
- deleteWord(self)
- This method obtains the data from the word that the user wants to delete.
This word is picked out from a ComboBox.
- dictionary(self, frame, inputword='brush up')
- This method shows the details associated with a specific word. If no
word is provided, the default one is "brush up".
Args:
frame: previous frame of the window to be deleted before creating
the new one.
inputword: word whose details has to be shown to the user. This
details are: word name, meaning, example (if it was provided
when the word was added to the database) and level. If no
word is provided, the default one is "brush up".
- diptPron(self, frame)
- This method shows the theory associated with the prounuciation of the
diphthongs.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- exit(self)
- Closes the window and sends the daily mail if required
- goToTheory(self, frame)
- This method shows the index associated with the prounuciation theory.
If the file "DOCS/book.pdf" exists, it creates a button to open it.
This file should be a grammar book. The developer of this code does
not accept any liability with regard to the copyright permissions to
show that book.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- importData(self, frame)
- Chooses an external ddbb and imports its words.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- isCurpass(self, curp)
- Checks if 2 inputs dont match while trying to change the current user's
password.
Args:
curp: string provided for the new user's password
- letsPlay(self)
- Shows a form with the configuration for the game.
- lookUpWord(self, frame, word='brush')
- This method shows the phonetic transcription associated with a specific
word. If no word is provided, the default one is "brush".
Args:
frame: previous frame of the window to be deleted before creating
the new one.
word: word whose phonetic transcription has to be shown to the user.
This transcription is shown as an image. If no word is provided,
the default one is "brush".
- newWord(self)
- This method presents a frame to fill in a form with the data of the new
word to add.
- raise_frame(self, frame)
- Raises a new frame inside the window.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- restartLevels(self, frame)
- This method connects to the database and updates the levels to 1
- showWords(self)
- This method is executed when the user wants to obtain a pdf with the
words stored in his/her database. Shows a form to obtain the
details: order by "date","word","level" or "word type" and
"ascending" or "descending" order
- statistics(self, frame)
- Frame to show the statistics related to the number of words per level.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- statsWord(self, frame)
- Frame to show the statistics related to the number of words per word
type.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- updateSize(self, frame, widthNew, heightNew)
- This method allows to change the information about the size of the
window. It connects to the properties file and save the new
configuration.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
widthNew: new width
heightNew: new height
- vowelsPron(self, frame)
- This method shows the theory associated with the prounuciation of the
vowels.
Args:
frame: previous frame of the window to be deleted before creating
the new one.
Static methods defined here:
- redirect(event)
- This method opens the predefined web browser and shows the
"wordreference" website.
Static method
- showError1()
- Returns an error related to incomplete information when the user is
filling in a form
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- showError2()
- Returns an error if the number of characters exceeds the minimum value
allowed (100)
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- showError3()
- Returns an error if the word type is not valid
Args:
frame: previous frame of the window to be deleted before creating
the new one.
- warnCopy()
- This method shows warning related to the copyright permissions.
Static method
|