Commit 9ad592d1 authored by Shashank Kumar's avatar Shashank Kumar

documentation updated

parent e763678d
......@@ -3,6 +3,7 @@ v0.0.1
## July 30 2018
- Generic Menus added in module_box to be used in any of the course modules for Menu navigation, Tools Menu and Tutorials Menu (Shashank Kumar - realslimshanky)
- Project restructued to provide meaningful separation between course modules and other modules (Shashank Kumar - realslimshanky)
## July 12 2018
......
[
{"application_settings": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"blog": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"cli": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"communication": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"encryption":[
{
"tutorials": [
{
"Encryption 101": {
"difficulty": "Beginner"
}
}
]
},
{
"tools": [
{
"Display and manage key pair": {
"difficulty": "Beginner"
},
"Create key pair": {
"difficulty": "Beginner"
},
"Encrypt a message": {
"difficulty": "Intermediate"
},
"Decrypt a message": {
"difficulty": "Intermediate"
}
}
]
}
]
{
"application_settings": {
"tutorials": [],
"tools": []
}
},
{"how_to_use": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"profile_settings": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"theme_settings": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"vcs": [
{
"tutorials": []
},
{
"tools": []
}
]},
{"way_ahead": [
{
"tutorials": []
},
{
"tools": []
}
]}
{
"blog": {
"tutorials": [],
"tools": []
}
},
{
"cli": {
"tutorials": [],
"tools": []
}
},
{
"communication": {
"tutorials": [],
"tools": []
}
},
{
"encryption": {
"tutorials": [
{
"title": "Encryption 101",
"difficulty": "Beginner"
}
],
"tools": [
{
"title": "Display and manage key pair",
"difficulty": "Beginner"
},
{
"title": "Create key pair",
"difficulty": "Beginner"
},
{
"title": "Encrypt a message",
"difficulty": "Intermediate"
},
{
"title": "Decrypt a message",
"difficulty": "Intermediate"
}
]
}
},
{
"how_to_use": {
"tutorials": [],
"tools": []
}
},
{
"profile_settings": {
"tutorials": [],
"tools": []
}
},
{
"theme_settings": {
"tutorials": [],
"tools": []
}
},
{
"vcs": {
"tutorials": [],
"tools": []
}
},
{
"way_ahead": {
"tutorials": [],
"tools": []
}
}
]
......@@ -87,6 +87,8 @@ There are two type of testing being done for this application.
- `modules` - This directory should and only contain the application login for different modules integrated to the Root Application. For example, this should contain the source for all application logic the tutorials and tools.
- `course_modules` - This directory contains all the Courseware modules and their tools and tutorials.
- `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.
......@@ -136,6 +138,8 @@ There are two type of testing being done for this application.
### The Courseware
The courseware modules are preset inside the `course_modules/` directory.
- How To Use - This module helps user getting started with New Contributor Wizard application and is placed in `how_to_use/`
- Communication - This module helps user understand importance of communication and the tools involved like IRC and mailing lists and is places in `communication/`
......
......@@ -12,4 +12,3 @@ class Blog(BoxLayout):
'''
Blog class for tutorials and tools
'''
pass
......@@ -2,14 +2,16 @@
Modules containing CLI classes
'''
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
Builder.load_file('./ui/cli.kv')
from modules.module_box.module_box import ModuleBox
class CLI(BoxLayout):
'''
Command Line Interface class for tutorials and tools
CLI class for tutorials and tools
'''
pass
def __init__(self, **kwargs):
super(CLI, self).__init__(**kwargs)
self.module_box = ModuleBox("cli")
self.add_widget(self.module_box)
......@@ -12,4 +12,3 @@ class Communication(BoxLayout):
'''
Communication class for tutorials and tools
'''
pass
......@@ -3,8 +3,6 @@ Modules containing Encryption classes
'''
from kivy.uix.boxlayout import BoxLayout
from modules.encryption.tutorials import tutorials
from modules.encryption.tools import tools
from modules.module_box.module_box import ModuleBox
......@@ -15,9 +13,5 @@ class Encryption(BoxLayout):
def __init__(self, **kwargs):
super(Encryption, self).__init__(**kwargs)
self.all_options = {
'tutorials': tutorials.Tutorials(),
'tools': tools.Tools(),
}
self.module_box = ModuleBox(self.all_options)
self.module_box = ModuleBox("encryption")
self.add_widget(self.module_box)
......@@ -8,21 +8,20 @@ from kivy.uix.popup import Popup
from kivy.lang import Builder
from kivy.clock import Clock
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.services import create_gpg_key_pair
from modules.encryption.tools.all_tools.validations import (
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.services import create_gpg_key_pair
from modules.course_modules.encryption.tools.validations import (
validate_email, validate_name, validate_comment, validate_expire_date
)
Builder.load_file('./ui/encryption/all_tools/create_key_pair.kv')
Builder.load_file('./ui/encryption/create_key_pair.kv')
class CreateKeyPairPopup(Popup):
'''
CreateKeyPairPopup displays popup to inform about key creation progress
'''
pass
class CreateKeyPair(BoxLayout):
......
......@@ -7,13 +7,13 @@ from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.lang import Builder
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.services import (
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.services import (
list_gpg_all_keys, decrypt_message, create_key_listing_widget
)
Builder.load_file('./ui/encryption/all_tools/decrypt_a_message.kv')
Builder.load_file('./ui/encryption/decrypt_a_message.kv')
class KeyColumnBox(GridLayout):
......
......@@ -7,13 +7,13 @@ from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.lang import Builder
from modules.encryption.tools.all_tools.utils import extract_key_uid_info
from modules.encryption.tools.all_tools.services import (
from modules.course_modules.encryption.tools.utils import extract_key_uid_info
from modules.course_modules.encryption.tools.services import (
list_gpg_all_keys, export_single_key
)
Builder.load_file('./ui/encryption/all_tools/display_and_manage_key_pair.kv')
Builder.load_file('./ui/encryption/display_and_manage_key_pair.kv')
class KeyColumnBox(GridLayout):
......
......@@ -7,12 +7,12 @@ from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.lang import Builder
from modules.encryption.tools.all_tools.services import (
from modules.course_modules.encryption.tools.services import (
list_gpg_all_keys, encrypt_message, create_key_listing_widget
)
Builder.load_file('./ui/encryption/all_tools/encrypt_a_message.kv')
Builder.load_file('./ui/encryption/encrypt_a_message.kv')
class KeyColumnBox(GridLayout):
......
......@@ -5,8 +5,8 @@ from subprocess import check_output
import gnupg
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.utils import extract_key_uid_info
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.utils import extract_key_uid_info
GNUPG_HOME = 'gnupg_home'
IS_KEY_PRIVATE = True
......
......@@ -4,8 +4,8 @@ Validation functions for encryption.tools module
import re
from datetime import datetime as dt
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.utils import (
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.utils import (
clean_email, clean_name
)
......
......@@ -13,4 +13,3 @@ class HowToUse(BoxLayout):
HowToUser class for introduction on how to user New
Contributor Wizard
'''
pass
......@@ -12,4 +12,3 @@ class VCS(BoxLayout):
'''
VCS class for tutorials and tools
'''
pass
......@@ -12,5 +12,3 @@ class WayAhead(BoxLayout):
'''
WayAhead class for tutorials and tools
'''
pass
\ No newline at end of file
......@@ -11,13 +11,13 @@ try:
except ImportError:
logging.info('Dashboard: Install navigationdrawer from garden')
from modules.blog.blog import Blog
from modules.cli.cli import CLI
from modules.communication.communication import Communication
from modules.encryption.encryption import Encryption
from modules.how_to_use.how_to_use import HowToUse
from modules.vcs.vcs import VCS
from modules.way_ahead.way_ahead import WayAhead
from modules.course_modules.blog.blog import Blog
from modules.course_modules.cli.cli import CLI
from modules.course_modules.communication.communication import Communication
from modules.course_modules.encryption.encryption import Encryption
from modules.course_modules.how_to_use.how_to_use import HowToUse
from modules.course_modules.vcs.vcs import VCS
from modules.course_modules.way_ahead.way_ahead import WayAhead
from modules.settings.application import ApplicationSettings
from modules.settings.profile import ProfileSettings
from modules.settings.theme import ThemeSettings
......@@ -30,4 +30,3 @@ class Dashboard(BoxLayout, Screen):
'''
Dashboard class to integrate courseware and settings
'''
pass
'''
Modules containing Tools classes for Encryption
'''
from kivy.uix.boxlayout import BoxLayout
from modules.module_box.module_tools_menu import ModuleToolsMenu
class Tools(BoxLayout):
'''
Tools class to present Tools menu of Encryption
'''
def __init__(self, **kwargs):
super(Tools, self).__init__(**kwargs)
self.module_tools_menu = ModuleToolsMenu("encryption")
self.add_widget(self.module_tools_menu)
'''
Modules containing Tutorials classes for Encryption
'''
from kivy.uix.boxlayout import BoxLayout
from modules.module_box.module_tutorials_menu import ModuleTutorialsMenu
class Tutorials(BoxLayout):
'''
Tutorials class for Encryption
'''
def __init__(self, **kwargs):
super(Tutorials, self).__init__(**kwargs)
self.module_tutorials_menu = ModuleTutorialsMenu("encryption")
self.add_widget(self.module_tutorials_menu)
......@@ -4,6 +4,9 @@ Modules containing ModuleBox classes
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from modules.module_box.module_tools_menu import ModuleToolsMenu
from modules.module_box.module_tutorials_menu import ModuleTutorialsMenu
Builder.load_file('./ui/module_box/module_box.kv')
......@@ -13,9 +16,12 @@ class ModuleBox(BoxLayout):
ModuleBox class for tutorials and tools
'''
def __init__(self, all_options, **kwargs):
def __init__(self, root_module_name, **kwargs):
super(ModuleBox, self).__init__(**kwargs)
self.all_options = all_options
self.all_options = {
'tutorials': ModuleTutorialsMenu(root_module_name),
'tools': ModuleToolsMenu(root_module_name),
}
self.all_options_items = list(self.all_options.keys())
def enable_option(self, option_to_enable):
......
......@@ -15,14 +15,12 @@ class ToolBox(BoxLayout):
'''
ToolBox class to present available tools
'''
pass
class BackToToolsMenu(BoxLayout):
'''
BackToToolsMenu class presents back button and tool title
'''
pass
class ModuleToolsMenu(BoxLayout):
......@@ -37,16 +35,18 @@ class ModuleToolsMenu(BoxLayout):
self.removed_tools_menu = None
self.root_module_name = root_module_name
with open('module_data.json') as data:
with open('data/module_data.json') as data:
json_data = json.loads(data.read())
self.module_data = json_data[4][self.root_module_name]
for data in json_data:
if self.root_module_name in data.keys():
self.module_data = data[self.root_module_name]
break
for key, value in self.module_data[1]["tools"][0].items():
value['title'] = key
tool_key = '_'.join(key.lower().split())
self.all_tools[tool_key] = value
self.populate_tools_menu()
if self.module_data["tools"]:
for tool in self.module_data["tools"]:
tool_key = '_'.join(tool['title'].lower().split())
self.all_tools[tool_key] = tool
self.populate_tools_menu()
def populate_tools_menu(self):
'''
......@@ -80,7 +80,7 @@ class ModuleToolsMenu(BoxLayout):
module_name = tool_to_import
class_name = ''.join(tool_to_import.title().split('_'))
tool_module = import_module(
'modules.' + self.root_module_name + '.tools.all_tools.' +
'modules.course_modules.' + self.root_module_name + '.tools.' +
module_name
)
tool_class = getattr(tool_module, class_name)
......
......@@ -7,7 +7,7 @@ import json
from kivy.uix.boxlayout import BoxLayout
from kivy.lang import Builder
from modules.parser import tutorial_parser
from modules.parsers import tutorial_parser
Builder.load_file('./ui/module_box/tutorials.kv')
......@@ -37,16 +37,18 @@ class ModuleTutorialsMenu(BoxLayout):
self.removed_tutorials_menu = None
self.root_module_name = root_module_name
with open('module_data.json') as data:
with open('data/module_data.json') as data:
json_data = json.loads(data.read())
self.module_data = json_data[4][self.root_module_name]
for data in json_data:
if self.root_module_name in data.keys():
self.module_data = data[self.root_module_name]
break
for key, value in self.module_data[0]["tutorials"][0].items():
value['title'] = key
tutorial_key = '_'.join(key.lower().split())
self.all_tutorials[tutorial_key] = value
self.populate_tutorials_menu()
if self.module_data["tutorials"]:
for tutorial in self.module_data["tutorials"]:
tutorial_key = '_'.join(tutorial['title'].lower().split())
self.all_tutorials[tutorial_key] = tutorial
self.populate_tutorials_menu()
def populate_tutorials_menu(self):
'''
......@@ -78,9 +80,9 @@ class ModuleTutorialsMenu(BoxLayout):
return requested tutorial by calling get_tutorial_widget of
tutorial_parser
'''
tutorial_to_import_path = os.path.join('modules', self.root_module_name,
'tutorials', 'all_tutorials',
tutorial_to_import)
tutorial_to_import_path = os.path.join('modules', 'course_modules',
self.root_module_name,
'tutorials', tutorial_to_import)
return tutorial_parser.get_tutorial_widget(tutorial_to_import_path)
def open_tutorial(self, button_object):
......
......@@ -11,7 +11,7 @@ from kivy.uix.button import Button
from kivy.core.window import Window
Builder.load_file('./ui/tutorial_parser.kv')
Builder.load_file('./ui/parsers/tutorial_parser.kv')
class LessonScreenManager(ScreenManager):
......
......@@ -13,4 +13,3 @@ class ApplicationSettings(BoxLayout):
ApplicationSettings class for settings related to New
Contributor Wizard application
'''
pass
......@@ -12,4 +12,3 @@ class ProfileSettings(BoxLayout):
'''
ProfileSettings class for settings related to signed in user
'''
pass
......@@ -12,4 +12,3 @@ class ThemeSettings(BoxLayout):
'''
ThemeSettings class for settings related to Theme of application
'''
pass
......@@ -2,11 +2,13 @@
This class contains signin module specific exceptions
'''
class SignInError(Exception):
'''
SignInError class can be used to raise exception related to
Sign In module
'''
def __init__(self, message):
self.message = message
super().__init__(message)
......@@ -8,6 +8,7 @@ class SignUpError(Exception):
SignUpError class can be used to raise exception related to
User's imput
'''
def __init__(self, message):
self.message = message
super().__init__(message)
import pytest
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.services import (
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.services import (
GNUPG_HOME,
create_gnupg_object,
create_gpg_key_pair,
......
......@@ -2,8 +2,8 @@ import datetime
import pytest
from modules.encryption.tools.all_tools.exceptions import GPGError
from modules.encryption.tools.all_tools.validations import (
from modules.course_modules.encryption.tools.exceptions import GPGError
from modules.course_modules.encryption.tools.validations import (
validate_name, validate_email, validate_comment, validate_expire_date
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment