Skip to content

Commit 784d231

Browse files
committed
Merge branch 'develop' of https://github.com/PythonFreeCourse/calendar into feature/translation
2 parents fb0a76d + 53c1b08 commit 784d231

26 files changed

+188238
-156
lines changed

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at lms@pythonic.guru. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Contributing
2+
👍🎉 First off, thanks for taking the time to contribute! 🎉👍
3+
4+
When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
5+
6+
Please note we have a [code of conduct](https://github.com/PythonFreeCourse/calendar/blob/master/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
7+
8+
## Pull Requests
9+
Create feature branches.
10+
11+
One pull request per feature - If you want to do more than one thing, send multiple pull requests.
12+
13+
Send coherent history - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
14+
15+
## Guide
16+
1. Fork the project.
17+
2. Create a new branch (`git checkout -b 'branch name'`).
18+
3. Commit your changes (`git commit -m 'Add something new'`).
19+
4. Push to the branch (`git push -u origin 'branch name'`).
20+
5. Open a Pull Request.
21+
22+
## Style Guide
23+
Follow the [commit messages specification](https://www.conventionalcommits.org/en/v1.0.0/).
24+
25+
Happy coding!

README.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,43 @@
11
# PyLander
22

3-
## Open Source Calendar built with Python
3+
<p align="center">
4+
<img title="Apache-2.0" src="https://img.shields.io/github/license/PythonFreeCourse/calendar.svg">
5+
</p>
46

5-
### Run on Windows:
7+
👋 Welcome to Open Source Calendar built with Python. 🐍
8+
9+
* [Project's objectives](#Project's-objectives)
10+
* [Creating development environment](#creating-development-environment)
11+
* [Contributing](#contributing)
12+
### Project's objectives
13+
1. Develop open source calendar tool using new technics while trying new things.
14+
2. Using Python as main programming language and plain HTML/JS for GUI.
15+
3. Create bonding in our community.
16+
17+
## Creating development environment
18+
### Prerequisites
19+
1. Windows or Linux based system - either [WSL on windows](https://docs.microsoft.com/en-us/windows/wsl/install-win10) or full blown linux.
20+
2. [Python](https://www.python.org/downloads/release/python-385/)
21+
22+
### Running on Windows
623

724
```shell
825
virtualenv env
926
.\env\Scripts\activate.bat
1027
pip install -r requirements.txt
11-
# Copy configuration.py.example to configuration.py.
28+
# Copy app\config.py.example to app\config.py.
29+
# Edit the variables' values.
30+
uvicorn app.main:app --reload
31+
```
32+
33+
### Running on Linux
34+
```shell
35+
python -m venv venv
36+
source venv/bin/activate
37+
pip install -r requirements.txt
38+
cp app/config.py.example app/configuration.py
1239
# Edit the variables' values.
1340
uvicorn app.main:app --reload
1441
```
42+
## Contributing
43+
View [contributing guidelines](https://github.com/PythonFreeCourse/calendar/blob/master/CONTRIBUTING.md).

app/config.py.example

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,15 @@ email_conf = ConnectionConfig(
4545
USE_CREDENTIALS=True,
4646
)
4747

48+
# import
49+
MAX_FILE_SIZE_MB = 5 # 5MB
50+
VALID_FILE_EXTENSION = (".txt", ".csv", ".ics") # Can import only these files.
51+
# Events must be within 20 years range from the current year.
52+
EVENT_VALID_YEARS = 20
53+
EVENT_HEADER_NOT_EMPTY = 1 # 1- for not empty, 0- for empty.
54+
EVENT_HEADER_LIMIT = 50 # Max characters for event header.
55+
EVENT_CONTENT_LIMIT = 500 # Max characters for event characters.
56+
MAX_EVENTS_START_DATE = 10 # Max Events with the same start date.
4857
# PATHS
4958
STATIC_ABS_PATH = os.path.abspath("static")
5059

app/dependencies.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from fastapi.templating import Jinja2Templates
55

66
from app import config
7+
from app.internal.logger_customizer import LoggerCustomizer
78

89

910
APP_PATH = os.path.dirname(os.path.realpath(__file__))
@@ -13,6 +14,14 @@
1314

1415
templates = Jinja2Templates(directory=TEMPLATES_PATH)
1516

17+
# Configure logger
18+
logger = LoggerCustomizer.make_logger(config.LOG_PATH,
19+
config.LOG_FILENAME,
20+
config.LOG_LEVEL,
21+
config.LOG_ROTATION_INTERVAL,
22+
config.LOG_RETENTION_INTERVAL,
23+
config.LOG_FORMAT)
24+
1625

1726
@lru_cache()
1827
def get_settings():

app/internal/event.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import re
2+
3+
from fastapi import HTTPException
4+
from starlette.status import HTTP_400_BAD_REQUEST
5+
6+
ZOOM_REGEX = re.compile(r'https://.*?\.zoom.us/[a-z]/.[^.,\b\s]+')
7+
8+
9+
def validate_zoom_link(location):
10+
if ZOOM_REGEX.search(location) is None:
11+
raise HTTPException(status_code=HTTP_400_BAD_REQUEST,
12+
detail="VC type with no valid zoom link")

0 commit comments

Comments
 (0)