summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-06 13:04:30 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-06 13:04:30 (GMT)
commite94e3799873d8b59b84d114e4b4a8c2fbb44635f (patch)
tree45e7cf0495cdf17e9527ba5530923158a3199e30
parenta60ab5ff45869757950a5184ad67de25801be62d (diff)
downloadpython-sievelib-e94e3799873d8b59b84d114e4b4a8c2fbb44635f.tar.gz
Add the Python packaging semantics
-rw-r--r--.gitignore1
-rw-r--r--COPYING13
-rw-r--r--MANIFEST.in2
-rw-r--r--PKG-INFO122
-rw-r--r--README.rst104
-rw-r--r--setup.cfg5
-rw-r--r--setup.py24
7 files changed, 271 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..0d20b64
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*.pyc
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..97bb275
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,13 @@
+Copyright (c) 2011-2012, Antoine Nguyen <tonio@ngyn.org>
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..9491f80
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include README.rst
+include COPYING
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..9990d1e
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,122 @@
+Metadata-Version: 1.1
+Name: sievelib
+Version: 0.5.1
+Summary: Client-side SIEVE library
+Home-page: http://bitbucket.org/tonioo/sievelib
+Author: Antoine Nguyen
+Author-email: tonio@ngyn.org
+License: MIT
+Description: sievelib
+ ========
+
+ Client-side Sieve and Managesieve library written in Python.
+
+ * Sieve : An Email Filtering Language
+ (`RFC 5228 <http://tools.ietf.org/html/rfc5228>`_)
+ * ManageSieve : A Protocol for Remotely Managing Sieve Scripts
+ (`Draft <http://tools.ietf.org/html/draft-martin-managesieve-12>`_)
+
+ Sieve tools
+ -----------
+
+ What is supported
+ ^^^^^^^^^^^^^^^^^
+
+ Currently, the provided parser supports most of the functionalities
+ described in the RFC. The only exception concerns section
+ *2.4.2.4. Encoding Characters Using "encoded-character"* which is not
+ supported.
+
+ The following extensions are also supported:
+
+ * Vacation (`RFC 5230 <http://tools.ietf.org/html/rfc5230>`_)
+
+ Basic usage
+ ^^^^^^^^^^^
+
+ The parser can either be used from the command-line::
+
+ $ cd sievelib
+ $ python parser.py test.sieve
+ Syntax OK
+ $
+
+ Or can be used from a python environment (or script/module)::
+
+ >>> from sievelib.parser import Parser
+ >>> p = Parser()
+ >>> p.parse('require ["fileinto"];')
+ True
+ >>> p.dump()
+ require (type: control)
+ ["fileinto"]
+ >>>
+ >>> p.parse('require ["fileinto"]')
+ False
+ >>> p.error
+ 'line 1: parsing error: end of script reached while semicolon expected'
+ >>>
+
+ Simple filters creation
+ ^^^^^^^^^^^^^^^^^^^^^^^
+
+ Some high-level classes are provided with the ``factory`` module, they
+ make the generation of Sieve rules easier::
+
+ >>> from sievelib.factory import FilterSet
+ >>> fs.addfilter("rule1",
+ ... [("Sender", ":is", "toto@toto.com"),],
+ ... [("fileinto", "Toto"),])
+ >>> fs.tosieve()
+ require ["fileinto"];
+
+ # Filter: rule1
+ if anyof (header :is "Sender" "toto@toto.com") {
+ fileinto "Toto";
+ }
+ >>>
+
+ Additionnal documentation is available with source code.
+
+ ManageSieve tools
+ -----------------
+
+ What is supported
+ ^^^^^^^^^^^^^^^^^
+
+ All mandatory commands are supported. The ``RENAME`` extension is
+ supported, with a simulated behaviour for server that do not support
+ it.
+
+ For the ``AUTHENTICATE`` command, supported mechanisms are ``DIGEST-MD5``,
+ ``PLAIN`` and ``LOGIN``.
+
+ Basic usage
+ ^^^^^^^^^^^
+
+ The ManageSieve client is intended to be used from another python
+ application (there isn't any shell provided)::
+
+ >>> from sievelib.managesieve import Client
+ >>> c = Client("server.example.com")
+ >>> c.connect("user", "password", starttls=False, authmech="DIGEST-MD5")
+ True
+ >>> c.listscripts()
+ ("active_script", ["script1", "script2"])
+ >>> c.setactive("script1")
+ True
+ >>> c.havespace("script3", 45)
+ True
+ >>>
+
+ Additionnal documentation is available with source code.
+
+Keywords: sieve,managesieve,parser,client
+Platform: UNKNOWN
+Classifier: Programming Language :: Python
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: OS Independent
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Classifier: Topic :: Communications :: Email :: Filters
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..f65bcc4
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,104 @@
+sievelib
+========
+
+Client-side Sieve and Managesieve library written in Python.
+
+* Sieve : An Email Filtering Language
+ (`RFC 5228 <http://tools.ietf.org/html/rfc5228>`_)
+* ManageSieve : A Protocol for Remotely Managing Sieve Scripts
+ (`Draft <http://tools.ietf.org/html/draft-martin-managesieve-12>`_)
+
+Sieve tools
+-----------
+
+What is supported
+^^^^^^^^^^^^^^^^^
+
+Currently, the provided parser supports most of the functionalities
+described in the RFC. The only exception concerns section
+*2.4.2.4. Encoding Characters Using "encoded-character"* which is not
+supported.
+
+The following extensions are also supported:
+
+* Vacation (`RFC 5230 <http://tools.ietf.org/html/rfc5230>`_)
+
+Basic usage
+^^^^^^^^^^^
+
+The parser can either be used from the command-line::
+
+ $ cd sievelib
+ $ python parser.py test.sieve
+ Syntax OK
+ $
+
+Or can be used from a python environment (or script/module)::
+
+ >>> from sievelib.parser import Parser
+ >>> p = Parser()
+ >>> p.parse('require ["fileinto"];')
+ True
+ >>> p.dump()
+ require (type: control)
+ ["fileinto"]
+ >>>
+ >>> p.parse('require ["fileinto"]')
+ False
+ >>> p.error
+ 'line 1: parsing error: end of script reached while semicolon expected'
+ >>>
+
+Simple filters creation
+^^^^^^^^^^^^^^^^^^^^^^^
+
+Some high-level classes are provided with the ``factory`` module, they
+make the generation of Sieve rules easier::
+
+ >>> from sievelib.factory import FilterSet
+ >>> fs.addfilter("rule1",
+ ... [("Sender", ":is", "toto@toto.com"),],
+ ... [("fileinto", "Toto"),])
+ >>> fs.tosieve()
+ require ["fileinto"];
+
+ # Filter: rule1
+ if anyof (header :is "Sender" "toto@toto.com") {
+ fileinto "Toto";
+ }
+ >>>
+
+Additionnal documentation is available with source code.
+
+ManageSieve tools
+-----------------
+
+What is supported
+^^^^^^^^^^^^^^^^^
+
+All mandatory commands are supported. The ``RENAME`` extension is
+supported, with a simulated behaviour for server that do not support
+it.
+
+For the ``AUTHENTICATE`` command, supported mechanisms are ``DIGEST-MD5``,
+``PLAIN`` and ``LOGIN``.
+
+Basic usage
+^^^^^^^^^^^
+
+The ManageSieve client is intended to be used from another python
+application (there isn't any shell provided)::
+
+ >>> from sievelib.managesieve import Client
+ >>> c = Client("server.example.com")
+ >>> c.connect("user", "password", starttls=False, authmech="DIGEST-MD5")
+ True
+ >>> c.listscripts()
+ ("active_script", ["script1", "script2"])
+ >>> c.setactive("script1")
+ True
+ >>> c.havespace("script3", 45)
+ True
+ >>>
+
+Additionnal documentation is available with source code.
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..861a9f5
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,5 @@
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..4d6d276
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,24 @@
+from setuptools import setup
+
+setup(
+ name = "sievelib",
+ packages = ["sievelib"],
+ version = "0.5.1",
+ description = "Client-side SIEVE library",
+ author = "Antoine Nguyen",
+ author_email = "tonio@ngyn.org",
+ url = "http://bitbucket.org/tonioo/sievelib",
+ license = "MIT",
+ keywords = ["sieve", "managesieve", "parser", "client"],
+ classifiers = [
+ "Programming Language :: Python",
+ "Development Status :: 4 - Beta",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: MIT License",
+ "Operating System :: OS Independent",
+ "Topic :: Software Development :: Libraries :: Python Modules",
+ "Topic :: Communications :: Email :: Filters"
+ ],
+
+ long_description = open("README.rst").read()
+)