Permalink
Browse files

multiplatform autopush command (works on windows, bsd, linux & mac).

  • Loading branch information...
benoitc committed May 6, 2011
1 parent af301a2 commit 130a3aa40a3fd8491840b6e638e0afc00d65fbdc
Showing with 12,259 additions and 535 deletions.
  1. +3 −0 MANIFEST.in
  2. +44 −51 NOTICE
  3. +0 −59 README.md
  4. +69 −0 README.rst
  5. 0 THANKS.txt → THANKS
  6. +17 −0 couchapp/autopush/brownie/__init__.py
  7. +88 −0 couchapp/autopush/brownie/abstract.py
  8. +162 −0 couchapp/autopush/brownie/caching.py
  9. +200 −0 couchapp/autopush/brownie/context.py
  10. +90 −0 couchapp/autopush/brownie/datastructures/__init__.py
  11. +53 −0 couchapp/autopush/brownie/datastructures/iterators.py
  12. +864 −0 couchapp/autopush/brownie/datastructures/mappings.py
  13. +81 −0 couchapp/autopush/brownie/datastructures/queues.py
  14. +698 −0 couchapp/autopush/brownie/datastructures/sequences.py
  15. +176 −0 couchapp/autopush/brownie/datastructures/sets.py
  16. +283 −0 couchapp/autopush/brownie/functional.py
  17. +50 −0 couchapp/autopush/brownie/importing.py
  18. +272 −0 couchapp/autopush/brownie/itools.py
  19. +134 −0 couchapp/autopush/brownie/parallel.py
  20. +490 −0 couchapp/autopush/brownie/proxies.py
  21. +51 −0 couchapp/autopush/brownie/text.py
  22. +174 −0 couchapp/autopush/command.py
  23. +21 −0 couchapp/autopush/pathtools/__init__.py
  24. +207 −0 couchapp/autopush/pathtools/path.py
  25. +265 −0 couchapp/autopush/pathtools/patterns.py
  26. +31 −0 couchapp/autopush/pathtools/version.py
  27. +1,910 −0 couchapp/autopush/select_backportmodule.c
  28. +20 −0 couchapp/autopush/select_backportmodule.h
  29. +22 −0 couchapp/autopush/watchdog/__init__.py
  30. +306 −0 couchapp/autopush/watchdog/_watchdog_fsevents.c
  31. +194 −0 couchapp/autopush/watchdog/_watchdog_fsevents.h
  32. +517 −0 couchapp/autopush/watchdog/_watchdog_util.c
  33. +536 −0 couchapp/autopush/watchdog/events.py
  34. +65 −0 couchapp/autopush/watchdog/observers/__init__.py
  35. +431 −0 couchapp/autopush/watchdog/observers/api.py
  36. +163 −0 couchapp/autopush/watchdog/observers/fsevents.py
  37. +784 −0 couchapp/autopush/watchdog/observers/inotify.py
  38. +724 −0 couchapp/autopush/watchdog/observers/kqueue.py
  39. +115 −0 couchapp/autopush/watchdog/observers/polling.py
  40. +129 −0 couchapp/autopush/watchdog/observers/read_directory_changes.py
  41. +75 −0 couchapp/autopush/watchdog/observers/read_directory_changes_async.py
  42. +246 −0 couchapp/autopush/watchdog/observers/winapi.py
  43. +139 −0 couchapp/autopush/watchdog/observers/winapi_common.py
  44. +106 −0 couchapp/autopush/watchdog/tricks/__init__.py
  45. +182 −0 couchapp/autopush/watchdog/utils/__init__.py
  46. +190 −0 couchapp/autopush/watchdog/utils/bricks.py
  47. +181 −0 couchapp/autopush/watchdog/utils/decorators.py
  48. +330 −0 couchapp/autopush/watchdog/utils/dirsnapshot.py
  49. +134 −0 couchapp/autopush/watchdog/utils/echo.py
  50. +57 −0 couchapp/autopush/watchdog/utils/platform.py
  51. +32 −0 couchapp/autopush/watchdog/version.py
  52. +6 −0 couchapp/commands.py
  53. 0 couchapp/ext/__init__.py
  54. +0 −370 couchapp/ext/autopush.py
  55. +1 −1 couchapp/simplejson/decoder.py
  56. +141 −54 setup.py
View
@@ -2,6 +2,9 @@ include LICENSE
include NOTICE
include README.md
include THANKS.txt
+recursive-include couchapp/autopush/*
+recursive-include couchapp/autopush/watchdog *
recursive-include couchapp/templates *
recursive-include tests/testapp *
recursive-include resources *
+recursive-include doc *
View
95 NOTICE
@@ -95,56 +95,49 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-couchapp.ssl
-------------
-Copyright Python Software Fundation
-Under Python Software Fundation (PSF) License 2
-
-
-1. This LICENSE AGREEMENT is between the Python Software Foundation
-("PSF"), and the Individual or Organization ("Licensee") accessing and
-otherwise using this software ("Python") in source or binary form and
-its associated documentation.
-
-2. Subject to the terms and conditions of this License Agreement, PSF
-hereby grants Licensee a nonexclusive, royalty-free, world-wide
-license to reproduce, analyze, test, perform and/or display publicly,
-prepare derivative works, distribute, and otherwise use Python
-alone or in any derivative version, provided, however, that PSF's
-License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
-2001, 2002, 2003, 2004 Python Software Foundation; All Rights Reserved"
-are retained in Python alone or in any derivative version prepared
-by Licensee.
-
-3. In the event Licensee prepares a derivative work that is based on
-or incorporates Python or any part thereof, and wants to make
-the derivative work available to others as provided herein, then
-Licensee hereby agrees to include in any such work a brief summary of
-the changes made to Python.
-
-4. PSF is making Python available to Licensee on an "AS IS"
-basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
-IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
-DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
-FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
-INFRINGE ANY THIRD PARTY RIGHTS.
-
-5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
-FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
-A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
-OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
-
-6. This License Agreement will automatically terminate upon a material
-breach of its terms and conditions.
-
-7. Nothing in this License Agreement shall be deemed to create any
-relationship of agency, partnership, or joint venture between PSF and
-Licensee. This License Agreement does not grant permission to use PSF
-trademarks or trade name in a trademark sense to endorse or promote
-products or services of Licensee, or any third party.
-
-8. By copying, installing or otherwise using Python, Licensee
-agrees to be bound by the terms and conditions of this License
-Agreement.
+couchapp.autopush.watchdog
+--------------------------
+Watchog - Python API to monitor file system events.
+Copyright (C) 2010 Yesudeep Mangalapilly <yesudeep@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+couchapp.autopush.pathtools
+---------------------------
+Copyright (C) 2010 Yesudeep Mangalapilly <yesudeep@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
View
@@ -1,59 +0,0 @@
-# CouchApp: Standalone CouchDB Application Development Made Simple
-
-CouchApp is designed to structure standalone CouchDB application development for maximum application portability.
-
-CouchApp is a set of scripts and a [jQuery](http://jquery.com) plugin designed to bring clarity and order to the freedom of [CouchDB](http://couchdb.org)'s document-based approach.
-
-### Write apps using just JavaScript and HTML
-
-Render HTML documents using JavaScript templates run by CouchDB. You'll get parallelism and cacheability, **using only HTML and JS.** Building standalone CouchDB applications according to correct principles affords you options not found on other platforms.
-
-### Deploy your apps to the client
-
-CouchDB's replication means that programs running locally, can still be social. Applications control replication data-flows, so publishing messages and subscribing to other people is easy. Your users will see the benefits of the web without the hassle of requiring always-on connectivity.
-
-## Installation
-
-Couchapp requires Python 2.5x or sup. To install couchapp using
-easy_install you must make sure you have a recent version of distribute installed:
-
- $ curl -O http://python-distribute.org/distribute_setup.py
- $ sudo python distribute_setup.py
- $ easy_install pip
-
-To install or upgrade to the latest released version of couchapp:
-
- $ pip install couchapp
-
-To install/upgrade development version :
-
- $ pip install git+http://github.com/couchapp/couchapp.git#egg=Couchapp
-
-Note: some installations need to use `sudo` command beafore each command line.
-
-To install on windows follow instructions
-[here](http://www.couchapp.org/page/windows-python-installers) .
-
-More installion options on the
-[website](http://www.couchapp.org/page/installing).
-
-## Getting started
-
-Read the [tutorial](http://www.couchapp.org/page/getting-started).
-
-## Other resources
-
-* [Frequently Asked Questions](http://couchapp.org/page/faq)
-* [couchapp command line usage](http://couchapp.org/page/couchapp-usage)
-* [Extend couchapp command line](http://couchapp.org/page/couchapp-extend)
-* [CouchApps with DesktopCouch](http://couchapp.org/page/desktopcouch)
-* [List of CouchApps](http://couchapp.org/page/list-of-couchapps)
-* [Video Tutorials and Screencasts](http://couchapp.org/page/videos)
-* [Roadmap](http://couchapp.org/page/roadmap)
-* [CouchApp Garden](http://couchapp.org/page/garden)
-* [Mailing List](http://groups.google.com/group/couchapp)
-* [Contributing to CouchApp](http://couchapp.org/page/how-to-contribute)
-* [Some development notes](http://couchapp.org/page/development-notes)
-* [Interactive Docs](http://couchapp.couchone.com/docs/_design/docs/index.html)
-* [Instruction on how to install this.pages app on your own machine](http://couchapp.org/page/pages-install)
-
View
@@ -0,0 +1,69 @@
+CouchApp: Standalone CouchDB Application Development Made Simple
+================================================================
+
+CouchApp is designed to structure standalone CouchDB application
+development for maximum application portability.
+
+CouchApp is a set of scripts and a `jQuery <http://jquery.com>`_ plugin
+designed to bring clarity and order to the freedom of
+`CouchDB <http://couchdb.apache.org>`_'s document-based approach.
+
+Write apps using just JavaScript and HTML
+-----------------------------------------
+
+Render HTML documents using JavaScript templates run by CouchDB. You'll
+get parallelism and cacheability, **using only HTML and JS.** Building
+standalone CouchDB applications according to correct principles affords
+you options not found on other platforms.
+
+Deploy your apps to the client
+++++++++++++++++++++++++++++++
+
+CouchDB's replication means that programs running locally, can still be
+social. Applications control replication data-flows, so publishing
+messages and subscribing to other people is easy. Your users will see
+the benefits of the web without the hassle of requiring always-on
+connectivity.
+
+Installation
+------------
+
+Couchapp requires Python 2.5x or sup. To install couchapp using
+easy_install you must make sure you have a recent version of distribute
+installed::
+
+ $ curl -O http://python-distribute.org/distribute_setup.py
+ $ sudo python distribute_setup.py
+ $ easy_install pip
+
+To install or upgrade to the latest released version of couchapp::
+
+ $ pip install couchapp
+
+To install/upgrade development version::
+
+ $ pip install git+http://github.com/couchapp/couchapp.git#egg=Couchapp
+
+Note: some installations need to use *sudo* command beafore each command
+line.
+
+To install on windows follow instructions `here
+<http://www.couchapp.org/page/windows-python-installers>`_.
+
+More installion options on the `website
+<http://www.couchapp.org/page/installing>`_.
+
+Getting started
+---------------
+
+Read the `tutorial <http://www.couchapp.org/page/getting-started>`_.
+
+## Other resources
+
+* `Couchapp website <http://couchapp.org>`_
+* `Frequently Asked Questions <http://couchapp.org/page/faq>`_
+* `couchapp command line usage
+ <http://couchapp.org/page/couchapp-usage>`_
+* `Extend couchapp command line`<http://couchapp.org/page/couchapp-extend>`_
+* `List of CouchApps `<http://couchapp.org/page/list-of-couchapps>`_
+
View
File renamed without changes.
@@ -0,0 +1,17 @@
+# coding: utf-8
+"""
+ brownie
+ ~~~~~~~
+
+ Brownie provides various different utilities and datastructures, which are
+ commonly used in Python applications.
+
+ :copyright: 2010-2011 by Daniel Neuhäuser
+ :license: BSD, see LICENSE.rst for details
+"""
+#: A string containing the full version number.
+__version__ = '0.5+'
+
+#: A tuple containing the full version number, which should be used for
+#: comparisons.
+__version_info__ = (0, 5)
@@ -0,0 +1,88 @@
+# coding: utf-8
+"""
+ brownie.abstract
+ ~~~~~~~~~~~~~~~~
+
+ Utilities to deal with abstract base classes.
+
+ .. versionadded:: 0.2
+
+ :copyright: 2010-2011 by Daniel Neuhäuser
+ :license: BSD, see LICENSE.rst for details
+"""
+try:
+ from abc import ABCMeta
+except ImportError:
+ class ABCMeta(type):
+ """Dummy :class:`abc.ABCMeta` implementation which does nothing."""
+
+ def register(self, subclass):
+ pass
+
+
+class VirtualSubclassMeta(type):
+ """
+ A metaclass which allows you to easily define abstract super classes,
+ simply inherit from this metaclass and set the
+ :attr:`virtual_superclasses` attribute to an iterable:
+
+ >>> from brownie.abstract import ABCMeta, VirtualSubclassMeta
+ >>>
+ >>> class VirtualBaseClass(object):
+ ... __metaclass__ = ABCMeta
+ >>>
+ >>> class VirtualSubclass(object):
+ ... __metaclass__ = VirtualSubclassMeta
+ ...
+ ... virtual_superclasses = (VirtualBaseClass, )
+ >>>
+ >>> issubclass(VirtualSubclass, VirtualBaseClass)
+ True
+ """
+ def __init__(self, name, bases, attributes):
+ type.__init__(self, name, bases, attributes)
+ self._register_superclasses(attributes.get('virtual_superclasses', ()))
+
+ def _register_superclasses(self, superclasses):
+ for cls in superclasses:
+ if isinstance(cls, ABCMeta):
+ cls.register(self)
+ if hasattr(cls, 'virtual_superclasses'):
+ self._register_superclasses(cls.virtual_superclasses)
+
+
+class AbstractClassMeta(ABCMeta, VirtualSubclassMeta):
+ """
+ A metaclass for abstract base classes which are also virtual subclasses.
+
+ Simply set :attr:`virtual_subclasses` to an iterable of classes your class
+ is supposed to virtually inherit from:
+
+ >>> from brownie.abstract import ABCMeta, AbstractClassMeta, \\
+ ... VirtualSubclassMeta
+ >>> class Foo(object):
+ ... __metaclass__ = ABCMeta
+ >>>
+ >>> class Bar(object):
+ ... __metaclass__ = AbstractClassMeta
+ ...
+ ... virtual_superclasses = (Foo, )
+ >>>
+ >>> class Baz(object):
+ ... __metaclass__ = VirtualSubclassMeta
+ ...
+ ... virtual_superclasses = (Bar, )
+ >>>
+ >>> issubclass(Baz, Foo)
+ True
+ >>> issubclass(Baz, Bar)
+ True
+
+ .. note::
+ All classes could use :class:`AbstractClassMeta` as `__metaclass__`
+ and the result would be the same, the usage here is just to demonstrate
+ the specific problem which is solved.
+ """
+
+
+__all__ = ['ABCMeta', 'VirtualSubclassMeta', 'AbstractClassMeta']
Oops, something went wrong.

0 comments on commit 130a3aa

Please sign in to comment.