-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added new 4 patterns to project information expert, composite, bridge…
…, high cohesion
- Loading branch information
Showing
9 changed files
with
80 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"email": "teacher1@pucit.edu.pk", | ||
"message": "Bidlksfklsdfion" | ||
"message": "New Update he he again" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import json | ||
from json import JSONDecodeError | ||
|
||
from teacher_controller import TeacherController | ||
|
||
if __name__ == "__main__": | ||
|
||
try: | ||
with open("config.json", mode="r") as file: | ||
raw_data = file.read() | ||
try: | ||
config_data: dict = json.loads(raw_data) | ||
except JSONDecodeError as e: | ||
raise Exception("The added configuration file has some errors. Consult from sample config file") | ||
except FileNotFoundError: | ||
raise Exception("The provided config file does not exist. Please create a config file using the sample config " | ||
"file") | ||
|
||
if len(config_data) == 2 and config_data.keys().__contains__("email") and config_data.keys().__contains__("message"): | ||
TeacherController(config_data['email']).notify(config_data['message']) | ||
else: | ||
raise Exception("Provided config file either does not contains required data and has extra or wrong data. " | ||
"Please consult from sample config file and provide correct data") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from abc import ABC, abstractmethod | ||
|
||
|
||
class Person(ABC): | ||
|
||
def __init__(self, id=None, email=None, name=None): | ||
self.id = id | ||
self.name = name | ||
self.email = email | ||
|
||
@abstractmethod | ||
def update(self): | ||
pass | ||
|
||
@abstractmethod | ||
def create(self): | ||
pass | ||
|
||
@abstractmethod | ||
def delete(self): | ||
pass | ||
|
||
@abstractmethod | ||
def view(self): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters