Created
March 12, 2018 14:32
-
-
Save thealphadollar/26fdc4d5f31f9519820c94331061132b to your computer and use it in GitHub Desktop.
To show how the ABC concept will be used to create Nephos API
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
import abc | |
class Nephos(): | |
""" | |
superclass Nephos with all necessary definitions | |
""" | |
__metaclass__ = abc.ABCMeta | |
# independent function | |
def remove(addr): | |
pass | |
# function dependent on Cloud API | |
@abc.abstractmethod | |
def upload(addr): | |
pass | |
class GDrive(Nephos): | |
""" | |
Google Drive implementation for Nephos | |
""" | |
def upload(addr): | |
# GDrive API method to upload file | |
class Dropbox(Nephos): | |
""" | |
Dropbox implementation for Nephos | |
""" | |
def upload(addr): | |
# Dropbox API method to upload file |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment