Skip to content

Commit

Permalink
Finished replacing all instances of 'go-cannon' with 'Hectane'.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-osman committed Oct 2, 2015
1 parent 29d7348 commit 21960fc
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 21 deletions.
File renamed without changes.
15 changes: 7 additions & 8 deletions pycannon/connection.py → pyhectane/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

class Connection:
"""
Connection to go-cannon for sending emails.
Connection to Hectane for sending emails.
"""

def __init__(self, host='localhost', port=8025, tls=False, username=None,
password=None):
"""
Provide the security information and credentials necessary to make
connections to the go-cannon API.
connections to the Hectane API.
"""
self._session = Session()
if username and password:
Expand All @@ -27,13 +27,12 @@ def __init__(self, host='localhost', port=8025, tls=False, username=None,

def _process_attachments(self, attachments):
"""
Create attachments suitable for delivery to go-cannon from the provided
Create attachments suitable for delivery to Hectane from the provided
list of attachments.
Each attachment may be either a local filename, a file object, or a
dict describing the content (in the same format as go-cannon). Note
that if the filename cannot be determined, it will be set to
"untitled".
dict describing the content (in the same format as Hectane). Note that
if the filename cannot be determined, it will be set to "untitled".
"""
for a in attachments:
if isinstance(a, dict):
Expand All @@ -55,7 +54,7 @@ def _process_attachments(self, attachments):
def send(self, from_, to, subject, text='', html='', cc=[], bcc=[],
attachments=[]):
"""
Send an email using go-cannon.
Send an email using Hectane.
"""
if isinstance(to, string_types):
raise TypeError('"to" parameter must be enumerable')
Expand All @@ -74,6 +73,6 @@ def send(self, from_, to, subject, text='', html='', cc=[], bcc=[],

def version(self):
"""
Obtain the current version of go-cannon.
Obtain the current version of Hectane.
"""
return self._session.get("{}/version".format(self._url)).json()
18 changes: 9 additions & 9 deletions pycannon/django.py → pyhectane/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
from .connection import Connection


class GoCannonBackend(BaseEmailBackend):
class HectaneBackend(BaseEmailBackend):
"""
Django email backend for go-cannon.
Django email backend for Hectane.
"""

def __init__(self, **kwargs):
"""
Initialize the connection to go-cannon.
Initialize the connection to Hectane.
"""
super(GoCannonBackend, self).__init__(**kwargs)
super(HectaneBackend, self).__init__(**kwargs)
self._connection = Connection(
host=getattr(settings, 'GO_CANNON_HOST', 'localhost'),
port=getattr(settings, 'GO_CANNON_PORT', 8025),
tls=getattr(settings, 'GO_CANNON_TLS', False),
username=getattr(settings, 'GO_CANNON_USERNAME', None),
password=getattr(settings, 'GO_CANNON_PASSWORD', None),
host=getattr(settings, 'HECTANE_HOST', 'localhost'),
port=getattr(settings, 'HECTANE_PORT', 8025),
tls=getattr(settings, 'HECTANE_TLS', False),
username=getattr(settings, 'HECTANE_USERNAME', None),
password=getattr(settings, 'HECTANE_PASSWORD', None),
)

def _process_attachments(self, email):
Expand Down
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@


setup(
name='pycannon',
version='0.3.0',
name='pyhectane',
version='0.3.1',
packages=find_packages(),
install_requires=[
'requests',
'six',
],
author='Nathan Osman',
author_email='nathan@quickmediasolutions.com',
description="Python module for sending emails with go-cannon",
description="Python module for sending emails with Hectane",
license='MIT',
url='https://github.com/nathan-osman/pycannon',
url='https://github.com/hectane/python-hectane',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
Expand Down

0 comments on commit 21960fc

Please sign in to comment.