Skip to content

Instantly share code, notes, and snippets.

@thealphadollar
Created March 12, 2018 14:32
Show Gist options
  • Save thealphadollar/26fdc4d5f31f9519820c94331061132b to your computer and use it in GitHub Desktop.
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
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