Commit 6c31617e authored by Shashank Kumar's avatar Shashank Kumar

Kivy Upgrade

- Kivy upgraded to 1.10.1
- Alternative script to `garden install` created in
`settings` module
parent d6b46042
# Python
*.pyc
/libs/garden
# For Tests
.pytest_cache
.coverage
......
......@@ -5,13 +5,15 @@ before_script:
- apt-get update -qy
- apt-get install -y python3 python3-dev python3-pip build-essential ffmpeg libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev libportmidi-dev libswscale-dev libavformat-dev libavcodec-dev zlib1g-dev
- apt-get install -y libgstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good
- apt-get install ffmpeg
- apt-get install -y ffmpeg git
- pip3 install pipenv
- pipenv install --dev --skip-lock
- pipenv install --skip-lock
- pipenv install --skip-lock git+http://github.com/kivy/kivy.git#egg=kivy-1.10.1
pylint:
type: test
script:
- pipenv install --skip-lock pylint
- pipenv run pylint main
- pipenv run pylint settings
- pipenv run pylint modules
......@@ -19,5 +21,5 @@ pylint:
pytest:
type: test
script:
- pipenv run pytest tests
- pipenv run pytest --cov=modules
- pipenv install --skip-lock pytest pytest-cov
- pipenv run pytest tests --cov=modules
......@@ -54,7 +54,8 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=pointless-string-statement,
disable=unused-import,
pointless-string-statement,
useless-super-delegation,
parameter-unpacking,
unpacking-in-except,
......
......@@ -9,8 +9,8 @@ pytest = "==3.6.0"
pytest-cov = "==2.5.1"
[packages]
cython = "==0.23"
kivy = "==1.9.1"
cython = "==0.28"
requests = "==2.19.1"
[requires]
python_version = "3.5"
{
"_meta": {
"hash": {
"sha256": "a1e80dc14c1f573c04eee5ed859d7a30c794411341211678052a33fb75fbbf4a"
"sha256": "b90ed5d6249df9449d0a974be301b56f57405fa4701abeba052913c5d5238b16"
},
"pipfile-spec": 6,
"requires": {
......@@ -16,20 +16,6 @@
]
},
"default": {
"atomicwrites": {
"hashes": [
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
],
"version": "==1.1.5"
},
"attrs": {
"hashes": [
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
],
"version": "==18.1.0"
},
"certifi": {
"hashes": [
"sha256:13e698f54293db9f89122b0581843a782ad0934a4fe0172d2a980ba77fc61bb7",
......@@ -44,6 +30,87 @@
],
"version": "==3.0.4"
},
"cython": {
"hashes": [
"sha256:02414e1cae1882d48e8fa9cdefb6e7bd3dd200a5dc5120a3905df164d23e7894",
"sha256:02540b24230fa8111ac5b2602ee61d4341adbe25d8b5a4ba8becf675c2253a36",
"sha256:047acc6712ee6fd97d661e9a804befe1307156d7595501bd1aeaaa882c01e8a9",
"sha256:086c082b77565382e1c67e864c0c4832d49dc38bdf551f69c789cbcec9b1d190",
"sha256:20c73f0af4df69948aff13183163613855a12973c66ddbeed83b079b73d83ea1",
"sha256:24078813387ce0613f8e1cb9f44e07a2abacb0ca2ec697886cb020c7628f6107",
"sha256:35696be120cf3c8505a461cf9ac7792fc92c938f9e92526a8b1bb581f802c920",
"sha256:44b94943552074b1644b9727395c06b6efbaf562083a9e2bd89c6a41d0df8159",
"sha256:518f7e22da54109661e483a91a63045203caf9fd78da4a69185a7622f759965f",
"sha256:5b9f283ca14b4d572d87f741b3c67a2d922d28e03d8bc692d700cfe4c7b94270",
"sha256:5c0bdd626e3e30656059383a0c2ee4150985ffe888c5951f2381f1120e281cd6",
"sha256:667f7f6da9951d3ab2ac5c50ee686bec42307f0d004483a981efc813caf76481",
"sha256:678f18c41248510e0ea924bc467b9586ec19726c01dd44f69086ab61c3406191",
"sha256:732f04055108a70571a2f5336dc2d07cd7ee8c63cc18777200604e7a0a9bb223",
"sha256:7abe6b8c7435f26ce022419d4a5bd5e81a9a31cc32d984939bb808709ecad528",
"sha256:96392fb9c6d69efd689fc62df5eb06a7efe8ef6c432b316d2cec4054710c13b5",
"sha256:995409aa518e87fd63098a6c2f437fa8483bd1be1485bb76446622663b071a3b",
"sha256:a1370f5c245980c61e815a073d5117ae56b1f56a83c473e2d49cdafec569581f",
"sha256:ac0b06430117241e59d07a3b965cbbdc62ac7315f5f6c3b9826740f80cf6ecd6",
"sha256:b654751d6e87de3dcea998a2afb438402a8e1bf4d60df91f163e2c086096b388",
"sha256:bb3f13351f13ee0fd920319589c14e3e1b8a8188c1ceeec780f9b77f6f627e7b",
"sha256:bbce622d2d0cacd810ee275db149950b7c4530eec0c4acfa8cf211079138b92d",
"sha256:c0fa07a0e1b33eb0d7ad4df5e9658367a40a4af0915ad652a7c7774368fbcca1",
"sha256:cad1cef5ea2bcd43d0391af921715150e84fb6122f322dde2f5faea68f6fdb13",
"sha256:d622bade45e1807f6149fee559e65a24b2ae54ab9d8ebfba2b546eec78a771de",
"sha256:d8de4ccc93a660adbeaacaa10a544072bc840a48a16680ece472c3d9c70989ce",
"sha256:dd889b21a275a516383c3bc4d65c7ba2bacee592a5478bd1b20421f2ec9702eb",
"sha256:ee7ccfcb3f46d6f8cea1eb6819c7d82c34e0f5bd8dda7c4413ccbbbb575565bb",
"sha256:fb0ea686f6e39bac3b070e43b2fda4cd47b08e6539390f3953b2c40117c40766",
"sha256:fee8d2fefbccd2029812a344e03fdd028bdf9147e4a0cb117ad2d1db14e46e11"
],
"index": "pypi",
"version": "==0.28"
},
"idna": {
"hashes": [
"sha256:156a6814fb5ac1fc6850fb002e0852d56c0c8d2531923a51032d1b70760e186e",
"sha256:684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
],
"version": "==2.7"
},
"requests": {
"hashes": [
"sha256:63b52e3c866428a224f97cab011de738c36aec0185aa91cfacd418b5d58911d1",
"sha256:ec22d826a36ed72a7358ff3fe56cbd4ba69dd7a6718ffd450ff0e9df7a47ce6a"
],
"index": "pypi",
"version": "==2.19.1"
},
"urllib3": {
"hashes": [
"sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf",
"sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5"
],
"version": "==1.23"
}
},
"develop": {
"astroid": {
"hashes": [
"sha256:0ef2bf9f07c3150929b25e8e61b5198c27b0dca195e156f0e4d5bdd89185ca1a",
"sha256:fc9b582dba0366e63540982c3944a9230cbc6f303641c51483fa547dcc22393a"
],
"version": "==1.6.5"
},
"atomicwrites": {
"hashes": [
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
],
"version": "==1.1.5"
},
"attrs": {
"hashes": [
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
],
"version": "==18.1.0"
},
"coverage": {
"hashes": [
"sha256:03481e81d558d30d230bc12999e3edffe392d244349a90f4ef9b88425fac74ba",
......@@ -85,131 +152,6 @@
],
"version": "==4.5.1"
},
"cython": {
"hashes": [
"sha256:0577d09011142d37c7a3f36009ace67dcab44b5bcea429a0b5b6321c64f5c6d3",
"sha256:084eef2602ee033138d670e43b0cba7be109de098439ed61bc6a9df6c3992e39",
"sha256:17442942e6fd0e120aac1b3a3b355fe4d420e5642b46e9d48185b8bf676ff776",
"sha256:4e4541bfe1e13ea4d77c1022bf55db6d7f6aa9d9ebf13bf0fbf339b96c943dbd",
"sha256:67c05d719f7e8b9989ee6e3ed8937897a95b9b0bb1d77845446feac6cd8045f9",
"sha256:753d107b1c439b6491182dd2a31bc46e81b96c8d9b270fd76543310c76a4363c",
"sha256:7e23a6b242880ff95f5835c72e4e2a5bec42f801b0c18176d4379c05894007a6",
"sha256:7f1e91b6cc537bc2dac5cdb3b9e2e6c1d84c08c2abdb1e3c4ec9cb5cbb824070",
"sha256:9fd01e8301c24fb3ba0411ad8eb16f5d9f9f8e66b1281fbe7aba2a9bd9d343dc",
"sha256:ab8474ef98c43cbc28fb9271f32b4475882ab366b081b0fa0dc03fd4394f1225",
"sha256:b544bcf1c67bb506528804dbe41a647b3fd37daafbef76432be6de16e25be1f7",
"sha256:c58496e09c819c700a2a5ec94b5f1cc2933fdebe9072cdefad482e666891615c"
],
"index": "pypi",
"version": "==0.23"
},
"idna": {
"hashes": [
"sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f",
"sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4"
],
"version": "==2.6"
},
"kivy": {
"hashes": [
"sha256:04212ba9dbae211be3da48f995230cb47cba996dbf4d87592054ca2223736966",
"sha256:1d624855206c77752c8d84805c2a9e5f23693a607e020cbac114e83f9e9f2b9a",
"sha256:29bc45be34c26a8acb1dafdd329145f997a473be344cd052659f821f6478637e",
"sha256:3b47df0771073831d19d652e6089c73cea46a33b21c92168483c23708f382779",
"sha256:e173b9be49ca3b124a24150dc76d70e933b3305579a7c4fc0a68924ec19b121a"
],
"index": "pypi",
"version": "==1.9.1"
},
"kivy-garden": {
"hashes": [
"sha256:9b7d9de5efacbcd0c4b3dd873b30622a86093c9965aa47b523c7a32f3eb34610",
"sha256:c256f42788421273a08fbb0a228f0fb0e80dd86b629fb8c0920507f645be6c72"
],
"version": "==0.1.4"
},
"more-itertools": {
"hashes": [
"sha256:2b6b9893337bfd9166bee6a62c2b0c9fe7735dcf85948b387ec8cba30e85d8e8",
"sha256:6703844a52d3588f951883005efcf555e49566a48afd4db4e965d69b883980d3",
"sha256:a18d870ef2ffca2b8463c0070ad17b5978056f403fb64e3f15fe62a52db21cc0"
],
"version": "==4.2.0"
},
"pluggy": {
"hashes": [
"sha256:7f8ae7f5bdf75671a718d2daf0a64b7885f74510bcd98b1a0bb420eb9a9d0cff",
"sha256:d345c8fe681115900d6da8d048ba67c25df42973bda370783cd58826442dcd7c",
"sha256:e160a7fcf25762bb60efc7e171d4497ff1d8d2d75a3d0df7a21b76821ecbf5c5"
],
"version": "==0.6.0"
},
"py": {
"hashes": [
"sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881",
"sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"
],
"version": "==1.5.3"
},
"pytest": {
"hashes": [
"sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d",
"sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a"
],
"version": "==3.6.0"
},
"pytest-cov": {
"hashes": [
"sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d",
"sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec"
],
"index": "pypi",
"version": "==2.5.1"
},
"requests": {
"hashes": [
"sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b",
"sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
],
"version": "==2.18.4"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
"sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb"
],
"version": "==1.11.0"
},
"urllib3": {
"hashes": [
"sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b",
"sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f"
],
"version": "==1.22"
}
},
"develop": {
"astroid": {
"hashes": [
"sha256:032f6e09161e96f417ea7fad46d3fac7a9019c775f202182c22df0e4f714cb1c",
"sha256:dea42ae6e0b789b543f728ddae7ddb6740ba33a49fb52c4a4d9cb7bb4aa6ec09"
],
"version": "==1.6.4"
},
"atomicwrites": {
"hashes": [
"sha256:240831ea22da9ab882b551b31d4225591e5e447a68c5e188db5b89ca1d487585",
"sha256:a24da68318b08ac9c9c45029f4a10371ab5b20e4226738e150e6e7c571630ae6"
],
"version": "==1.1.5"
},
"attrs": {
"hashes": [
"sha256:4b90b09eeeb9b88c35bc642cbac057e45a5fd85367b985bd2809c62b7b939265",
"sha256:e0d0eb91441a3b53dab4d9b743eafc1ac44476296a2053b6ca3af0b139faf87b"
],
"version": "==18.1.0"
},
"isort": {
"hashes": [
"sha256:1153601da39a25b14ddc54955dbbacbb6b2d19135386699e2ad58517953b34af",
......@@ -277,10 +219,10 @@
},
"py": {
"hashes": [
"sha256:29c9fab495d7528e80ba1e343b958684f4ace687327e6f789a94bf3d1915f881",
"sha256:983f77f3331356039fdd792e9220b7b8ee1aa6bd2b25f567a963ff1de5a64f6a"
"sha256:3fd59af7435864e1a243790d322d763925431213b6b8529c6ca71081ace3bbf7",
"sha256:e31fb2767eb657cbde86c454f02e99cb846d3cd9d61b318525140214fdc0e98e"
],
"version": "==1.5.3"
"version": "==1.5.4"
},
"pylint": {
"hashes": [
......@@ -295,8 +237,17 @@
"sha256:39555d023af3200d004d09e51b4dd9fdd828baa863cded3fd6ba2f29f757ae2d",
"sha256:c76e93f3145a44812955e8d46cdd302d8a45fbfc7bf22be24fe231f9d8d8853a"
],
"index": "pypi",
"version": "==3.6.0"
},
"pytest-cov": {
"hashes": [
"sha256:03aa752cf11db41d281ea1d807d954c4eda35cfa1b21d6971966cc041bbf6e2d",
"sha256:890fe5565400902b0c78b5357004aab1c814115894f4f21370e2433256a3eeec"
],
"index": "pypi",
"version": "==2.5.1"
},
"six": {
"hashes": [
"sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9",
......
v0.0.1
## June 7 2018
- Sign Up feature added.
## June 11 2018
- Adding Dashboard feature
- Adding blog, cli, communication, encryption, how_to_use, vcs and way_ahead modules for courseware
- Adding application, profile and theme modules for settings
- Adding Dashboard feature (Shashank Kumar)
- Adding blog, cli, communication, encryption, how_to_use, vcs and way_ahead modules for courseware (Shashank Kumar)
- Adding application, profile and theme modules for settings (Shashank Kumar)
## June 7 2018
- Sign Up feature added. (Shashank Kumar)
## June 3 2018
- Reporting coverage while running Gitlab CI.
- Reporting coverage while running Gitlab CI. (Shashank Kumar)
## June 1 2018
- Initial app setup using Kivy.
- Integrate pylint, pytest and support for Gitlab CI.
- Initial app setup using Kivy. (Shashank Kumar)
- Integrate pylint, pytest and support for Gitlab CI. (Shashank Kumar)
......@@ -52,7 +52,11 @@ Step 4: Install application dependencies (this might take a while, grab a cup of
`$ pipenv install`
Step 5: Run New Contributor Wizard
Step 5: Install Kivy
`$ pipenv install --skip-lock git+http://github.com/kivy/kivy.git#egg=kivy-1.10.1`
Step 6: Run New Contributor Wizard
`$ pipenv run python main.py`
......@@ -88,7 +92,7 @@ There are two type of testing being done for this application.
- `tests` - This directory should and only contain the Test written for the application, both for application logic and GUI.
- `ui` - This directory should and only contain the `.kv` files which uses Kivy Language in order to create the widget tree.
- `ui` - This directory should and only contain the `.kv` files which uses Kivy Language in order to create the widget tree.
### Sign Up Module
......
......@@ -3,25 +3,27 @@ Root Kivy Application
'''
from kivy.app import App
from kivy.config import Config
from kivy.uix.screenmanager import ScreenManager
from settings import initializing_database
from modules.signup import signup
from modules.dashboard import dashboard
from settings import initializing_database, installing_kivy_garden_package
class NewContributorWizard(App):
'''
Declaration of Root Kivy App which contains Root Widget
'''
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.screen_manager_obj = ScreenManager()
self.screen_manager_obj.add_widget(signup.SignUp(name='signup'))
self.screen_manager_obj.add_widget(dashboard.Dashboard(name='dashboard'))
def build(self):
return self.screen_manager_obj
'''
Overridding build method of App class to load custom kv file
'''
self.load_kv('./ui/main.kv')
def switch_screen_to_dashboard(self):
'''
This method helps clear the widget and switch directly to the Dashboard
'''
self.root.clear_widgets()
self.root.add_widget(Dashboard())
if __name__ == '__main__':
......@@ -29,15 +31,16 @@ if __name__ == '__main__':
Setting up things
'''
initializing_database()
installing_kivy_garden_package('navigationdrawer')
'''
Setting window width to 720px and height to 480px
'''
Config.set('graphics', 'width', '720')
Config.set('graphics', 'height', '480')
Config.set('graphics', 'resizable', False)
# Importing modules
from modules.dashboard.dashboard import Dashboard
from modules.signup.signup import SignUp
'''
Running Kivy application and building root Widget
'''
# Fixing touch issue with some platforms
Config.set('input', 'mouse', 'mouse')
Config.set('graphics', 'minimum_width', 720)
Config.set('graphics', 'minimum_height', 480)
# Running Kivy application and building root Widget
NewContributorWizard().run()
'''
Dashboard module includes classes to showcase Dashboard with different courseware and settings
'''
from copy import copy as cp
import logging
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.uix.screenmanager import Screen
try:
from libs.garden.navigationdrawer import NavigationDrawer
except ImportError:
logging.info('Dashboard: Install navigationdrawer from garden')
from modules.blog.blog import Blog
from modules.cli.cli import CLI
......@@ -26,50 +30,4 @@ class Dashboard(BoxLayout, Screen):
'''
Dashboard class to integrate courseware and settings
'''
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.all_menu_screens = {
'application_settings': ApplicationSettings(),
'blog': Blog(),
'cli': CLI(),
'communication': Communication(),
'encryption': Encryption(),
'how_to_use': HowToUse(),
'profile_settings': ProfileSettings(),
'theme_settings': ThemeSettings(),
'vcs': VCS(),
'way_ahead': WayAhead(),
}
self.all_menu_items = list(self.all_menu_screens.keys())
self.enable_menu('how_to_use')
def on_touch_down(self, touch):
'''
on_touch_down is triggered when user clicks the application anywhere
overiding this function here to perform actions on selection of menu items
'''
for menu_item in self.all_menu_items:
if self.ids[menu_item+'_box'].collide_point(*touch.pos):
self.enable_menu(menu_item)
def enable_menu(self, menu_item_to_enable):
'''
enable_menu function focuses on concerned menu items or settings which is clicked and
removes focus from all other menu items and settings
'''
menu_item_to_enable_widget = self.ids[menu_item_to_enable+'_box']
menu_item_to_enable_color = menu_item_to_enable_widget.canvas.before.children[0].rgba
if menu_item_to_enable_color != [1, 1, 1, 1] or 'settings' in menu_item_to_enable:
self.ids['module_screen'].add_widget(self.all_menu_screens[menu_item_to_enable])
if 'settings' not in menu_item_to_enable:
self.ids[menu_item_to_enable+'_box'].canvas.before.children[0].rgba = [1, 1, 1, 1]
self.ids[menu_item_to_enable+'_label'].color = (0, 0, 0, 1)
all_menu_items_copy = cp(self.all_menu_items)
all_menu_items_copy.remove(menu_item_to_enable)
for menu_item in all_menu_items_copy:
if 'settings' not in menu_item:
self.ids[menu_item+'_box'].canvas.before.children[0].rgba = [0, 0, 0, 1]
self.ids[menu_item+'_label'].color = (1, 1, 1, 1)
self.ids['module_screen'].remove_widget(self.all_menu_screens[menu_item])
pass
......@@ -3,6 +3,7 @@ Class for SignUp Screen
'''
import logging
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from kivy.clock import Clock
......@@ -25,34 +26,26 @@ class SignUp(BoxLayout, Screen):
'''
Declaration of SignUp Screen Class
'''
def __init__(self, **kwargs):
'''
Creating instance of vaidation class
Creating instance of updateBD class
'''
super().__init__(**kwargs)
def prompt_error_message(self, label, error_text):
'''
Displays error message on the UI on the respective label widget
'''
original_text = self.ids[label].text
self.ids[label].text = error_text
self.ids[label].color = (255, 0, 0, 1)
self.ids[label].color = [1, 0, 0, 1]
def replace_label(*args):
'''
Replacing original text in label
delay time is defined by args[0]
'''
self.ids[label].text = original_text
self.ids[label].color = [1, 1, 1, 1]
logging.info(
'\'%s\' changed to \'%s\' after %s seconds',
error_text,
original_text,
args[0]
)
self.ids[label].text = original_text
self.ids[label].color = (255, 255, 255, 1)
Clock.schedule_once(replace_label, 2)
def validate(self):
......@@ -105,11 +98,12 @@ class SignUp(BoxLayout, Screen):
return email_validation and pass_validation and full_name_validation
def sign_up(self):
def sign_up(self, *args):
'''
Signing Up user's account in case of successful validation
Prompting error message to the user otherwise
'''
app_object = args[0]
if self.validate():
user_email = self.ids['user_email'].text
user_pass = self.ids['first_pass'].text
......@@ -125,7 +119,7 @@ class SignUp(BoxLayout, Screen):
}
try:
sign_up_user(**user_info)
self.manager.current = 'dashboard'
app_object.switch_screen_to_dashboard()
except SignUpError as error:
self.prompt_error_message(
'email_label',
......
......@@ -2,8 +2,13 @@
Initializing application dependencies
- Sqlite3 database
'''
import os
import sqlite3
import logging
from zipfile import ZipFile
from io import BytesIO
import requests
DATABASE_FILE = 'new_contributor_wizard.db'
USER_INFOMATION_TABLE = 'USERS'
......@@ -29,3 +34,44 @@ def initializing_database():
return connection
except sqlite3.OperationalError:
return connection
def installing_kivy_garden_package(package_name):
'''
Installing garden package and moving it to 'libs/garden/'
'''
logging.basicConfig(level=logging.INFO)
if not package_name.startswith('garden.'):
package_name = 'garden.' + package_name
url = 'https://github.com/kivy-garden/{}/archive/master.zip'.format(
package_name
)
compact_package_name = package_name.split('garden.')[1]
root_directory = os.getcwd()
existing_garden_packages = os.listdir(root_directory + '/libs/garden')
if compact_package_name in existing_garden_packages:
logging.info('Garden: %s exists', compact_package_name)
return
logging.info('Garden: Downloading %s ...', url)
response = requests.get(url)
if response.status_code != 200:
logging.info('''Garden: Unable to find the garden package.
(error=%s)''', response.status_code)
return
data = b''
for buf in response.iter_content(1024):
data += buf
logging.info('Garden: Download done (%s downloaded)', package_name)
ZipFile(BytesIO(data)).extractall()
for existing_files_folders in os.listdir(root_directory):
if 'garden.' in existing_files_folders:
new_name = root_directory + '/libs/garden/' + compact_package_name
os.rename(existing_files_folders, new_name)
success_log = compact_package_name + ' relocated to ' + new_name
logging.info('Garden: %s', success_log)
break
<Dashboard>:
BoxLayout:
size_hint: 0.3, 1
orientation: 'vertical'
BoxLayout:
size_hint: 1, 0.1
BoxLayout:
size_hint: 1, 0.8
orientation: 'vertical'
id: dashboard_menu
BoxLayout:
size_hint: 1, 0.142
padding: 0, 0, 10, 0
id: how_to_use_box
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text_size: self.size
size: self.texture_size
valign: 'middle'
halign: 'right'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 20
text: 'How To Use'
id: how_to_use_label
BoxLayout:
size_hint: 1, 0.142
padding: 0, 0, 10, 0
id: communication_box
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Communication'
text_size: self.size
size: self.texture_size
valign: 'middle'
halign: 'right'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 20
id: communication_label
BoxLayout:
size_hint: 1, 0.142
padding: 0, 0, 10, 0
id: cli_box
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'CLI'
text_size: self.size
size: self.texture_size
valign: 'middle'
halign: 'right'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 20
id: cli_label
BoxLayout:
size_hint: 1, 0.142
padding: 0, 0, 10, 0
id: blog_box
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Blog'
text_size: self.size
size: self.texture_size
valign: 'middle'
halign: 'right'
font_name: 'ui/assets/fonts/VarelaRound-Regular.ttf'
font_size: 20
id: blog_label
BoxLayout:
size_hint: 1, 0.142
padding: 0, 0, 10, 0
id: vcs_box
canvas.before:
Color:
rgba: 0, 0, 0, 1
Rectangle:
pos: self.pos
size: self.size
Label:
text: 'Version Control'
text_size: self.size
size: self.texture_size
valign: 'middle'
halign: 'right'