8000 Built inital directory structure for design pattern implementations to follow · Pull Request #59 · trekhleb/learn-python · GitHub
[go: up one dir, main page]

Skip to content
8000

Built inital directory structure for design pattern implementations to follow #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Forgot the whiteline at the file end, also standardized my use of spa…
…ces and newlines
  • Loading branch information
sveneschlbeck committed Nov 7, 2021
commit 88a703cbf78d947343a02315ba39ae6be262c35e
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def filter(self, content):
filtered_content = filter.filter(content)




# Command
class RenameFileCommand(object):
"""Command execution when needed"""
Expand Down Expand Up @@ -85,4 +83,4 @@ def undo(self):
history.execute(RenameFileCommand('docs/cv.doc', 'docs/cv-en.doc'))
history.execute(RenameFileCommand('docs/cv1.doc', 'docs/cv-bg.doc'))
history.undo()
history.undo()
history.undo()
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ def execute(self, user, action):
command.authenticate = config.authenticate
command.authorize = config.authorize

command.execute(current_user, delete_user_action)
command.execute(current_user, delete_user_action)
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ def fuel_level(self):
return self._tank.level




# Adapter --> similar to Bridge and Proxy
import socket

Expand All @@ -69,8 +67,6 @@ def log(message, destination):
log('Something happened', udp_destination)




# Decorator
"""Introducing additional functionality without inheritance"""

Expand Down Expand Up @@ -118,4 +114,4 @@ def decorated(*args, **kwargs):
@authorized_only
@authenticated_only
def execute(action, *args, **kwargs):
return action()
return action()
0