mailman-api-0.2.9/0000755000175000017500000000000012421703563015364 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/stdeb.cfg0000644000175000017500000000006512416010367017144 0ustar terceiroterceiro00000000000000[DEFAULT] Package: mailman-api Package3: mailman-api mailman-api-0.2.9/mailman_api.egg-info/0000755000175000017500000000000012421703563021325 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/mailman_api.egg-info/dependency_links.txt0000644000175000017500000000000112421703563025373 0ustar terceiroterceiro00000000000000 mailman-api-0.2.9/mailman_api.egg-info/top_level.txt0000644000175000017500000000001312421703563024051 0ustar terceiroterceiro00000000000000mailmanapi mailman-api-0.2.9/mailman_api.egg-info/PKG-INFO0000644000175000017500000000305012421703563022420 0ustar terceiroterceiro00000000000000Metadata-Version: 1.0 Name: mailman-api Version: 0.2.9 Summary: REST API daemon to interact with Mailman 2 Home-page: http://pypi.python.org/pypi/mailman-api/ Author: Sergio Oliveira Author-email: sergio@tracy.com.br License: LICENSE.txt Description: mailman-api =========== `mailman-api` provides a daemon that will listen to HTTP requests, providing access to a REST API that can be used to interact with a locally-installed Mailman instance. Documentation -------------- Documentation available at: http://mailman-api.readthedocs.org/ Licensing information --------------------- Copyright (C) 2013-2014 Sergio Oliveira This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Platform: UNKNOWN mailman-api-0.2.9/mailman_api.egg-info/SOURCES.txt0000644000175000017500000000074212421703563023214 0ustar terceiroterceiro00000000000000MANIFEST.in README.rst requirements.txt setup.py stdeb.cfg docs/Makefile docs/api.rst docs/conf.py docs/index.rst docs/license.rst docs/quickstart.rst init/sysv/mailman-api mailman_api.egg-info/PKG-INFO mailman_api.egg-info/SOURCES.txt mailman_api.egg-info/dependency_links.txt mailman_api.egg-info/requires.txt mailman_api.egg-info/top_level.txt mailmanapi/__init__.py mailmanapi/api.py mailmanapi/members.py mailmanapi/utils.py mailmanapi/templates/message.tpl scripts/mailman-apimailman-api-0.2.9/mailman_api.egg-info/requires.txt0000644000175000017500000000004112421703563023720 0ustar terceiroterceiro00000000000000Paste >= 1.7.5.1 bottle >= 0.11.6mailman-api-0.2.9/setup.py0000644000175000017500000000203212420004346017063 0ustar terceiroterceiro00000000000000import os import re import codecs from setuptools import setup def read(*parts): return codecs.open(os.path.join(os.path.dirname(__file__), *parts), encoding='utf8').read() def find_version(*file_paths): version_file = read(*file_paths) version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M) if version_match: return version_match.group(1) raise RuntimeError("Unable to find version string.") setup( name='mailman-api', version=find_version('mailmanapi/__init__.py'), author='Sergio Oliveira', author_email='sergio@tracy.com.br', packages=['mailmanapi'], package_data={'mailmanapi': ['templates/*']}, scripts=['scripts/mailman-api'], url='http://pypi.python.org/pypi/mailman-api/', license='LICENSE.txt', description='REST API daemon to interact with Mailman 2', long_description=read('README.rst'), install_requires=[ "Paste >= 1.7.5.1", "bottle >= 0.11.6", ], ) mailman-api-0.2.9/setup.cfg0000644000175000017500000000007312421703563017205 0ustar terceiroterceiro00000000000000[egg_info] tag_build = tag_date = 0 tag_svn_revision = 0 mailman-api-0.2.9/requirements.txt0000644000175000017500000000003612420004346020637 0ustar terceiroterceiro00000000000000Paste==1.7.5.1 bottle==0.11.6 mailman-api-0.2.9/init/0000755000175000017500000000000012421703563016327 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/init/sysv/0000755000175000017500000000000012421703563017333 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/init/sysv/mailman-api0000755000175000017500000000240212421703532021440 0ustar terceiroterceiro00000000000000#!/bin/sh ### BEGIN INIT INFO # Provides: mailman-api # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Mailman API # Description: Starts and stops the mailman-api daemon. ### END INIT INFO # Author: Antonio Terceiro DESC="Mailman REST API" NAME=mailman-api DAEMON=/usr/bin/$NAME PIDFILE=/var/run/${NAME}.pid OPTIONS='' if [ -r /etc/default/$NAME ]; then . /etc/default/$NAME fi test -x "$DAEMON" || exit if [ -z "$DEAMON_USER" ]; then if [ -d /var/lib/mailman/archives/private ]; then DAEMON_USER=$(stat -c %U /var/lib/mailman/archives/private) else if id list >/dev/null 2>&1; then DAEMON_USER=list else DAEMON_USER=mailman fi fi fi . /lib/lsb/init-functions do_start() { start-stop-daemon --start --exec $DAEMON --pidfile $PIDFILE --make-pidfile --name $NAME --user $DAEMON_USER --background -- $OPTIONS } do_stop() { start-stop-daemon --stop --name $NAME --pidfile $PIDFILE } case "$1" in start) do_start ;; stop) do_stop ;; restart|force-reload) do_stop do_start ;; *) echo "usage: $0 start|stop|restart" exit 3 ;; esac exit 0 mailman-api-0.2.9/README.rst0000644000175000017500000000204212420004346017041 0ustar terceiroterceiro00000000000000mailman-api =========== `mailman-api` provides a daemon that will listen to HTTP requests, providing access to a REST API that can be used to interact with a locally-installed Mailman instance. Documentation -------------- Documentation available at: http://mailman-api.readthedocs.org/ Licensing information --------------------- Copyright (C) 2013-2014 Sergio Oliveira This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. mailman-api-0.2.9/scripts/0000755000175000017500000000000012421703563017053 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/scripts/mailman-api0000755000175000017500000000255312421703532021167 0ustar terceiroterceiro00000000000000#!/usr/bin/env python import sys from optparse import OptionParser from bottle import run def parse_options(): parser = OptionParser() parser.add_option("-b", "--bind", dest="bind", default='127.0.0.1:8000', help="Bind address. Default: '127.0.0.1:8000'.") parser.add_option("--allow-from", action="append", default=['127.0.0.1'], dest="allow_from", help=("IPs to allow incoming requests. By deufalt only " "allow connections from '127.0.0.1'.")) parser.add_option("-l", "--mailman-lib-path", dest="mailmanlib_path", default='/usr/lib/mailman', help=("Path to mailman libs directory. " "Default: '/usr/lib/mailman'.")) parser.add_option("-d", "--debug", action="store_true", default=False, help="Print debug information") (options, args) = parser.parse_args() return options if __name__ == '__main__': opt = parse_options() # Add mailman to path # Must be done before importing get_application sys.path.append(opt.mailmanlib_path) from mailmanapi.api import get_application application = get_application(opt.allow_from) host, port = opt.bind.split(':') run(application, host=host, port=port, debug=opt.debug, server='paste') mailman-api-0.2.9/mailmanapi/0000755000175000017500000000000012421703563017474 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/mailmanapi/templates/0000755000175000017500000000000012421703563021472 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/mailmanapi/templates/message.tpl0000644000175000017500000000042512415507652023644 0ustar terceiroterceiro00000000000000Received: by {{ip_from}} with HTTP; {{timestamp}} % if defined('in_reply_to'): In-Reply-To: {{!in_reply_to}} % end Content-Type: text/plain; charset=UTF-8 From: {{name_from}} <{{email_from}}> To: {{email_to}} Message-ID: <{{message_id}}> Subject: {{subject}} {{body}} mailman-api-0.2.9/mailmanapi/__init__.py0000644000175000017500000000002612421703532021577 0ustar terceiroterceiro00000000000000__version__ = '0.2.9' mailman-api-0.2.9/mailmanapi/members.py0000644000175000017500000000026612415507652021510 0ustar terceiroterceiro00000000000000 class Member(object): def __init__(self, fullname=None, address=None, digest=None): self.fullname = fullname self.address = address self.digest = digest mailman-api-0.2.9/mailmanapi/api.py0000644000175000017500000001165412420004346020616 0ustar terceiroterceiro00000000000000 import os import uuid import logging from bottle import route, request, template, default_app try: from Mailman import Utils, Errors, Post, mm_cfg except ImportError: logging.error('Could not import Mailman module') from .members import Member from .utils import parse_boolean, jsonify, get_mailinglist, get_timestamp CWD = os.path.abspath(os.path.dirname(__file__)) EMAIL_TEMPLATE = os.path.join(CWD, 'templates', 'message.tpl') @route('/', method='GET') def list_lists(): """Lists existing mailing lists on the server. **Method**: GET **URI**: / Returns a list of the mailing lists that exist on this server.""" all_lists = Utils.list_names() lists = [] include_description = request.query.get('description') address = request.query.get('address') for listname in all_lists: mlist = get_mailinglist(listname, lock=False) members = mlist.getMembers() if not address or address in members: if include_description: lists.append((listname, mlist.description.decode('latin1'))) else: lists.append(listname) return jsonify(lists) @route('/', method='PUT') def subscribe(listname): """Adds a new subscriber to the list called `` **Method**: PUT **URI**: / **Parameters**: * `address`: email address that is to be subscribed to the list. * `fullname`: full name of the person being subscribed to the list. * `digest`: if this equals `true`, the new subscriber will receive digests instead of every mail sent to the list. """ address = request.forms.get('address') fullname = request.forms.get('fullname') digest = parse_boolean(request.forms.get('digest')) mlist = get_mailinglist(listname) userdesc = Member(fullname, address, digest) try: mlist.ApprovedAddMember(userdesc, ack=True, admin_notif=True) except Errors.MMAlreadyAMember: return jsonify("Address already a member.", 409) except Errors.MembershipIsBanned: return jsonify("Banned address.", 403) except (Errors.MMBadEmailError, Errors.MMHostileAddress): return jsonify("Invalid address.", 400) else: mlist.Save() finally: mlist.Unlock() return jsonify(True) @route('/', method='DELETE') def unsubscribe(listname): """Unsubsribe an email address from the mailing list. **Method**: DELETE **URI**: / **Parameters**: * `address`: email address that is to be unsubscribed from the list """ address = request.forms.get('address') mlist = get_mailinglist(listname) try: mlist.ApprovedDeleteMember(address, admin_notif=False, userack=True) mlist.Save() except Errors.NotAMemberError: return jsonify("Not a member.", 404) finally: mlist.Unlock() return jsonify(True) @route('/', method='GET') def members(listname): """Lists subscribers for the `listname` list. **Method**: GET **URI**: / Returns an array of email addresses.""" mlist = get_mailinglist(listname, lock=False) return jsonify(mlist.getMembers()) @route('//sendmail', method='POST') def sendmail(listname): """Posts an email to the mailing list. **Method**: POST **URI**: //sendmail **Parameters**: * `name_from`: name of the poster * `email_from`: email address of the poster * `subject`: the subject of the message * `body`: the body of the message. * `in_reply_to` (optional): Message-ID of the message that is being replied to, if any.""" mlist = get_mailinglist(listname, lock=False) context = {} context['email_to'] = mlist.GetListEmail() context['message_id'] = uuid.uuid1() context['ip_from'] = request.environ.get('REMOTE_ADDR') context['timestamp'] = get_timestamp() context['name_from'] = request.forms.get('name_from') context['email_from'] = request.forms.get('email_from') context['subject'] = request.forms.get('subject') context['body'] = request.forms.get('body') in_reply_to = request.forms.get('in_reply_to') if in_reply_to: context['in_reply_to'] = in_reply_to if None in context.values(): return jsonify('Missing information. `email_from`, `subject` and ' '`body` are mandatory', 400) email = template(EMAIL_TEMPLATE, context) Post.inject(listname, email.encode('utf8'), qdir=mm_cfg.INQUEUE_DIR) return jsonify(True) def get_application(allowed_ips): bottle_app = default_app() def application(environ, start_response): if environ['REMOTE_ADDR'] not in allowed_ips: status = '403 FORBIDDEN' headers = [('Content-type', 'text/plain')] start_response(status, headers) return 'FORBIDDEN' return bottle_app(environ, start_response) return application mailman-api-0.2.9/mailmanapi/utils.py0000644000175000017500000000143312420004346021177 0ustar terceiroterceiro00000000000000 import json import logging from time import strftime from bottle import HTTPResponse try: from Mailman import MailList, Errors except ImportError: logging.error('Could not import Mailman module') def parse_boolean(value): if value and value.lower() == 'true': return True return False def jsonify(body='', status=200): response = HTTPResponse(content_type='application/json') response.body = json.dumps(body) response.status = status return response def get_mailinglist(listname, lock=True): try: return MailList.MailList(listname, lock=lock) except Errors.MMUnknownListError: raise jsonify("Unknown Mailing List `{}`.".format(listname), 404) def get_timestamp(): return strftime('%a, %d %b %Y %H:%M:%S %z (%Z)') mailman-api-0.2.9/docs/0000755000175000017500000000000012421703563016314 5ustar terceiroterceiro00000000000000mailman-api-0.2.9/docs/index.rst0000644000175000017500000000073512420004346020152 0ustar terceiroterceiro00000000000000mailman-api =========== Release v\ |version| mailman-api provides a daemon that will listen to HTTP requests, providing access to a REST API that can be used to interact with a locally-installed Mailman (version 2) instance. mailman-api is tested with Python 2.7 and depends on: - paste >= 1.7 - bottle >= 0.11.6 mailman-api is a work in progress. Contributions are welcome. Feel free to fork and contribute! .. toctree:: :maxdepth: 2 quickstart api license mailman-api-0.2.9/docs/api.rst0000644000175000017500000000100012420004346017576 0ustar terceiroterceiro00000000000000API Documentation ================= Requests can be made to any of the URI's below, strictly using the HTTP methods indicated. The body of all responses contains valid JSON objects. Unless otherwise noted, successful requests get as response a 200 (OK) status code for response, and true in the response body. Failed requests will get responses with some HTTP error code in the 400s, and a string describing the problem in the response body. Supported methods: .. automodule:: mailmanapi.api :members: mailman-api-0.2.9/docs/conf.py0000644000175000017500000002034012420004346017602 0ustar terceiroterceiro00000000000000# -*- coding: utf-8 -*- # # mailman-api documentation build configuration file, created by # sphinx-quickstart on Tue Oct 14 15:21:00 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys import os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) sys.path.insert(0, os.path.abspath('..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode', ] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'mailman-api' copyright = u'2014, Sergio Oliveira Campos' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. from mailmanapi import __version__ version = __version__ # The full version, including alpha/beta/rc tags. release = version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all # documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. #keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. #html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'mailman-apidoc' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ('index', 'mailman-api.tex', u'mailman-api Documentation', u'Sergio Oliveira', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'mailman-api', u'mailman-api Documentation', [u'Sergio Oliveira'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'mailman-api', u'mailman-api Documentation', u'Sergio Oliveira', 'mailman-api', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False mailman-api-0.2.9/docs/license.rst0000644000175000017500000000140612420004346020461 0ustar terceiroterceiro00000000000000Licensing Information ===================== Copyright (C) 2013-2014 Sergio Oliveira Campos This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. mailman-api-0.2.9/docs/quickstart.rst0000644000175000017500000000215312420004346021231 0ustar terceiroterceiro00000000000000Quickstart =========== Installation ------------ Pip +++ You can use pip to install mailman-api and requirements: .. code-block:: sh $ pip install mailman-api Distro Packages +++++++++++++++ We are currently working to provide linux packages (deb and rpm). Stay tunned! .. TODO: Add here links to official packages (.deb and .rpm) Running the Sevice ------------------- To start the service manually just run the `mailman-api` command. If you installed mailman-api from a distribution package you should be able to start your service by running `service mailman-api start`. Usage: mailman-api [options] Options: -h, --help show this help message and exit -b BIND, --bind=BIND Bind address. Default: '127.0.0.1:8000'. --allow-from=ALLOW_FROM IPs to allow incoming requests. By deufalt only allow connections from '127.0.0.1'. -l MAILMANLIB_PATH, --mailman-lib-path=MAILMANLIB_PATH Path to mailman libs directory. Default: '/usr/lib/mailman'. -d, --debug Print debug information mailman-api-0.2.9/docs/Makefile0000644000175000017500000001517612420004346017756 0ustar terceiroterceiro00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/mailman-api.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/mailman-api.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/mailman-api" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/mailman-api" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." mailman-api-0.2.9/PKG-INFO0000644000175000017500000000305012421703563016457 0ustar terceiroterceiro00000000000000Metadata-Version: 1.0 Name: mailman-api Version: 0.2.9 Summary: REST API daemon to interact with Mailman 2 Home-page: http://pypi.python.org/pypi/mailman-api/ Author: Sergio Oliveira Author-email: sergio@tracy.com.br License: LICENSE.txt Description: mailman-api =========== `mailman-api` provides a daemon that will listen to HTTP requests, providing access to a REST API that can be used to interact with a locally-installed Mailman instance. Documentation -------------- Documentation available at: http://mailman-api.readthedocs.org/ Licensing information --------------------- Copyright (C) 2013-2014 Sergio Oliveira This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Platform: UNKNOWN mailman-api-0.2.9/MANIFEST.in0000644000175000017500000000026512421504645017125 0ustar terceiroterceiro00000000000000include requirements.txt include stdeb.cfg include docs/conf.py include docs/Makefile recursive-include docs *.rst recursive-include init * recursive-include mailmanapi/templates *