Creation of Google_calendar plugin alarm type.
Creation of functionality for our system
The plugin must Be compatible with Python 3 and uses “class” (object oriented programming)
Our system environment is a Debian 8.2
The need is to create functionality where Google users can plan an event per day, in order that our system could recuperate the beginning date and hour of the event.
In functional validation mode, we tested the script: .[login to view URL]
Pre-requirements: The final user must encrypt his “Application api calendar” at this web address:
[login to view URL]
The authentication method to use the Google calendar’s API is free. We have tested and approved the method used in Quickstart/python.
We will store every plugin parameters in a [login to view URL] file, following the development method “ID clients Oauth 2.0” will be store in the client_secret.json.
The main goal of the “Class” is to:
• Recover in a calendar named variable (Define in the [login to view URL] file)
• The next event including in the title the text ##EVENT ## (Variable defined in the [login to view URL] file)
This event must be today (But in the future) or tomorrow, if this is another date we do nothing.
If we do nothing, we must verify again in a 24H delay (Delay configurable in the [login to view URL] file, by default 24h.)
If we get an answer, the plugin send back to our system the date and hour of the start of the event. ( with the format YYYYMMDDHHMM (Year month day hour minutes without space and local time zone).
The function can be launch in a planned thread or manually
At this moment, the users interface is not choosen(Pygame,QT,Kivy….)
But within a class:
• We need an object that allow to modify each variables : calendar’s name, look in the title to find the text, the key for the authentication etc…
• We need an object to get back and display each variables in the future typing zone
• The text of each typing zone came from language file. An object will allow to display it
The plugin must follow the arborescence
plugin\alarm-gcalendar
plugin\alarm-gcalendar\language
plugin\alarm-gcalendar\img
It will be composed of these next files
plugin\alarm-gcalendar\[login to view URL]
plugin\alarm-gcalendar\[login to view URL]
plugin\alarm-gcalendar\[login to view URL] (si nécessaire)
plugin\alarm-gcalendar\language\[login to view URL]
The variables List will be store in the [login to view URL] ([login to view URL])
CalendarName ; Texte2Find ; IDclient ; SyncEvery ; …
In the language repertory will be the language file > [login to view URL] [login to view URL] etc…
The default language of the Plugin is [login to view URL], the language choice is made by using the language attribute of the User object.
If the language of the user doesn’t exist, we use en.json. We will handle the translation.
The formatting of the language file must be:
{
"CalendarName": "Primary",
"IDclient": "Your ID Client"
}