diff --git a/bin/couchapp.py b/bin/couchapp.py deleted file mode 100644 index 6c2c43f8..00000000 --- a/bin/couchapp.py +++ /dev/null @@ -1,8 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of couchapp released under the Apache 2 license. -# See the NOTICE for more information. - -from couchapp.dispatch import run - -run() \ No newline at end of file diff --git a/couchapp/__init__.pyo b/couchapp/__init__.pyo new file mode 100644 index 00000000..1a0f5988 Binary files /dev/null and b/couchapp/__init__.pyo differ diff --git a/couchapp/client.pyo b/couchapp/client.pyo new file mode 100644 index 00000000..e31c1b79 Binary files /dev/null and b/couchapp/client.pyo differ diff --git a/couchapp/clone_app.pyo b/couchapp/clone_app.pyo new file mode 100644 index 00000000..9c90401d Binary files /dev/null and b/couchapp/clone_app.pyo differ diff --git a/couchapp/commands.pyo b/couchapp/commands.pyo new file mode 100644 index 00000000..dfdc9b2a Binary files /dev/null and b/couchapp/commands.pyo differ diff --git a/couchapp/config.py b/couchapp/config.py index cdab1c3f..06a2dae0 100644 --- a/couchapp/config.py +++ b/couchapp/config.py @@ -5,9 +5,9 @@ import os -from couchapp.client import Database -from couchapp.errors import AppError -from couchapp import util +from .client import Database +from .errors import AppError +from . import util class Config(object): """ main object to read configuration from ~/.couchapp.conf or @@ -20,13 +20,12 @@ class Config(object): extensions = [], hooks = {}, vendors = [ - "egg:couchapp#git", - "egg:couchapp#hg", - "egg:couchapp#couchdb" + "python:couchapp.vendors.backends.git#GitVendor", + "python:couchapp.vendors.backends.hg#HgVendor", + "python:couchapp.vendors.backends.couchdb#CouchdbVendor" ] ) - def __init__(self): self.rc_path = util.rcpath() self.global_conf = self.load(self.rc_path, self.DEFAULTS) diff --git a/couchapp/config.pyo b/couchapp/config.pyo new file mode 100644 index 00000000..08df4465 Binary files /dev/null and b/couchapp/config.pyo differ diff --git a/couchapp/dispatch.pyo b/couchapp/dispatch.pyo new file mode 100644 index 00000000..716169d7 Binary files /dev/null and b/couchapp/dispatch.pyo differ diff --git a/couchapp/errors.pyo b/couchapp/errors.pyo new file mode 100644 index 00000000..8f4cb141 Binary files /dev/null and b/couchapp/errors.pyo differ diff --git a/couchapp/generator.py b/couchapp/generator.py index fe115a5c..d15ed2ba 100644 --- a/couchapp/generator.py +++ b/couchapp/generator.py @@ -152,6 +152,9 @@ def generate_function(path, kind, name, template=None): def copy_helper(path, directory, tname="templates"): """ copy helper used to generate an app""" + if tname == "vendor": + tname = os.path.join("templates", tname) + templatedir = find_template_dir(tname, directory) if templatedir: if directory == "vendor": @@ -160,7 +163,7 @@ def copy_helper(path, directory, tname="templates"): os.makedirs(path) except: pass - + for root, dirs, files in os.walk(templatedir): rel = relpath(root, templatedir) if rel == ".": diff --git a/couchapp/generator.pyo b/couchapp/generator.pyo new file mode 100644 index 00000000..01519554 Binary files /dev/null and b/couchapp/generator.pyo differ diff --git a/couchapp/localdoc.pyo b/couchapp/localdoc.pyo new file mode 100644 index 00000000..ff8e9613 Binary files /dev/null and b/couchapp/localdoc.pyo differ diff --git a/couchapp/macros.pyo b/couchapp/macros.pyo new file mode 100644 index 00000000..88f4c900 Binary files /dev/null and b/couchapp/macros.pyo differ diff --git a/couchapp/restkit/__init__.pyo b/couchapp/restkit/__init__.pyo new file mode 100644 index 00000000..698fcd83 Binary files /dev/null and b/couchapp/restkit/__init__.pyo differ diff --git a/couchapp/restkit/client/__init__.pyo b/couchapp/restkit/client/__init__.pyo new file mode 100644 index 00000000..ffa5ea5d Binary files /dev/null and b/couchapp/restkit/client/__init__.pyo differ diff --git a/couchapp/restkit/client/request.pyo b/couchapp/restkit/client/request.pyo new file mode 100644 index 00000000..21169b54 Binary files /dev/null and b/couchapp/restkit/client/request.pyo differ diff --git a/couchapp/restkit/client/response.pyo b/couchapp/restkit/client/response.pyo new file mode 100644 index 00000000..68c438ec Binary files /dev/null and b/couchapp/restkit/client/response.pyo differ diff --git a/couchapp/restkit/conn/__init__.pyo b/couchapp/restkit/conn/__init__.pyo new file mode 100644 index 00000000..155f7eb0 Binary files /dev/null and b/couchapp/restkit/conn/__init__.pyo differ diff --git a/couchapp/restkit/conn/base.pyo b/couchapp/restkit/conn/base.pyo new file mode 100644 index 00000000..a403aed8 Binary files /dev/null and b/couchapp/restkit/conn/base.pyo differ diff --git a/couchapp/restkit/conn/http_connection.pyo b/couchapp/restkit/conn/http_connection.pyo new file mode 100644 index 00000000..9f9d8107 Binary files /dev/null and b/couchapp/restkit/conn/http_connection.pyo differ diff --git a/couchapp/restkit/conn/threaded.pyo b/couchapp/restkit/conn/threaded.pyo new file mode 100644 index 00000000..cb9e17f7 Binary files /dev/null and b/couchapp/restkit/conn/threaded.pyo differ diff --git a/couchapp/restkit/errors.pyo b/couchapp/restkit/errors.pyo new file mode 100644 index 00000000..f355d9ef Binary files /dev/null and b/couchapp/restkit/errors.pyo differ diff --git a/couchapp/restkit/filters/__init__.pyo b/couchapp/restkit/filters/__init__.pyo new file mode 100644 index 00000000..85b383d4 Binary files /dev/null and b/couchapp/restkit/filters/__init__.pyo differ diff --git a/couchapp/restkit/filters/basicauth.pyo b/couchapp/restkit/filters/basicauth.pyo new file mode 100644 index 00000000..f8fb30c9 Binary files /dev/null and b/couchapp/restkit/filters/basicauth.pyo differ diff --git a/couchapp/restkit/filters/oauth2.pyo b/couchapp/restkit/filters/oauth2.pyo new file mode 100644 index 00000000..e8ab810e Binary files /dev/null and b/couchapp/restkit/filters/oauth2.pyo differ diff --git a/couchapp/restkit/filters/simpleproxy.pyo b/couchapp/restkit/filters/simpleproxy.pyo new file mode 100644 index 00000000..01594303 Binary files /dev/null and b/couchapp/restkit/filters/simpleproxy.pyo differ diff --git a/couchapp/restkit/forms.pyo b/couchapp/restkit/forms.pyo new file mode 100644 index 00000000..46b0c8ef Binary files /dev/null and b/couchapp/restkit/forms.pyo differ diff --git a/couchapp/restkit/http/__init__.pyo b/couchapp/restkit/http/__init__.pyo new file mode 100644 index 00000000..9f44baae Binary files /dev/null and b/couchapp/restkit/http/__init__.pyo differ diff --git a/couchapp/restkit/http/body.pyo b/couchapp/restkit/http/body.pyo new file mode 100644 index 00000000..da029c2d Binary files /dev/null and b/couchapp/restkit/http/body.pyo differ diff --git a/couchapp/restkit/http/message.pyo b/couchapp/restkit/http/message.pyo new file mode 100644 index 00000000..8263554a Binary files /dev/null and b/couchapp/restkit/http/message.pyo differ diff --git a/couchapp/restkit/http/parser.pyo b/couchapp/restkit/http/parser.pyo new file mode 100644 index 00000000..0709f1c3 Binary files /dev/null and b/couchapp/restkit/http/parser.pyo differ diff --git a/couchapp/restkit/http/unreader.pyo b/couchapp/restkit/http/unreader.pyo new file mode 100644 index 00000000..82029389 Binary files /dev/null and b/couchapp/restkit/http/unreader.pyo differ diff --git a/couchapp/restkit/resource.pyo b/couchapp/restkit/resource.pyo new file mode 100644 index 00000000..27568799 Binary files /dev/null and b/couchapp/restkit/resource.pyo differ diff --git a/couchapp/restkit/util/__init__.pyo b/couchapp/restkit/util/__init__.pyo new file mode 100644 index 00000000..1ffc64be Binary files /dev/null and b/couchapp/restkit/util/__init__.pyo differ diff --git a/couchapp/restkit/util/oauth2.pyo b/couchapp/restkit/util/oauth2.pyo new file mode 100644 index 00000000..19043a2c Binary files /dev/null and b/couchapp/restkit/util/oauth2.pyo differ diff --git a/couchapp/restkit/util/sock.pyo b/couchapp/restkit/util/sock.pyo new file mode 100644 index 00000000..c3c3b150 Binary files /dev/null and b/couchapp/restkit/util/sock.pyo differ diff --git a/templates/app/README.md b/couchapp/templates/app/README.md similarity index 100% rename from templates/app/README.md rename to couchapp/templates/app/README.md diff --git a/templates/app/_attachments/index.html b/couchapp/templates/app/_attachments/index.html similarity index 100% rename from templates/app/_attachments/index.html rename to couchapp/templates/app/_attachments/index.html diff --git a/templates/app/_attachments/style/main.css b/couchapp/templates/app/_attachments/style/main.css similarity index 100% rename from templates/app/_attachments/style/main.css rename to couchapp/templates/app/_attachments/style/main.css diff --git a/templates/app/couchapp.json b/couchapp/templates/app/couchapp.json similarity index 100% rename from templates/app/couchapp.json rename to couchapp/templates/app/couchapp.json diff --git a/templates/app/evently/items/_changes/data.js b/couchapp/templates/app/evently/items/_changes/data.js similarity index 100% rename from templates/app/evently/items/_changes/data.js rename to couchapp/templates/app/evently/items/_changes/data.js diff --git a/templates/app/evently/items/_changes/mustache.html b/couchapp/templates/app/evently/items/_changes/mustache.html similarity index 100% rename from templates/app/evently/items/_changes/mustache.html rename to couchapp/templates/app/evently/items/_changes/mustache.html diff --git a/templates/app/evently/items/_changes/query.json b/couchapp/templates/app/evently/items/_changes/query.json similarity index 100% rename from templates/app/evently/items/_changes/query.json rename to couchapp/templates/app/evently/items/_changes/query.json diff --git a/templates/app/evently/profile/profileReady/mustache.html b/couchapp/templates/app/evently/profile/profileReady/mustache.html similarity index 100% rename from templates/app/evently/profile/profileReady/mustache.html rename to couchapp/templates/app/evently/profile/profileReady/mustache.html diff --git a/templates/app/evently/profile/profileReady/selectors/form/submit.js b/couchapp/templates/app/evently/profile/profileReady/selectors/form/submit.js similarity index 100% rename from templates/app/evently/profile/profileReady/selectors/form/submit.js rename to couchapp/templates/app/evently/profile/profileReady/selectors/form/submit.js diff --git a/templates/app/language b/couchapp/templates/app/language similarity index 100% rename from templates/app/language rename to couchapp/templates/app/language diff --git a/templates/app/views/recent-items/map.js b/couchapp/templates/app/views/recent-items/map.js similarity index 100% rename from templates/app/views/recent-items/map.js rename to couchapp/templates/app/views/recent-items/map.js diff --git a/templates/functions/filter.js b/couchapp/templates/functions/filter.js similarity index 100% rename from templates/functions/filter.js rename to couchapp/templates/functions/filter.js diff --git a/templates/functions/list.js b/couchapp/templates/functions/list.js similarity index 100% rename from templates/functions/list.js rename to couchapp/templates/functions/list.js diff --git a/templates/functions/map.js b/couchapp/templates/functions/map.js similarity index 100% rename from templates/functions/map.js rename to couchapp/templates/functions/map.js diff --git a/templates/functions/reduce.js b/couchapp/templates/functions/reduce.js similarity index 100% rename from templates/functions/reduce.js rename to couchapp/templates/functions/reduce.js diff --git a/templates/functions/show.js b/couchapp/templates/functions/show.js similarity index 100% rename from templates/functions/show.js rename to couchapp/templates/functions/show.js diff --git a/templates/functions/spatial.js b/couchapp/templates/functions/spatial.js similarity index 100% rename from templates/functions/spatial.js rename to couchapp/templates/functions/spatial.js diff --git a/templates/functions/update.js b/couchapp/templates/functions/update.js similarity index 100% rename from templates/functions/update.js rename to couchapp/templates/functions/update.js diff --git a/templates/functions/validate_doc_update.js b/couchapp/templates/functions/validate_doc_update.js similarity index 100% rename from templates/functions/validate_doc_update.js rename to couchapp/templates/functions/validate_doc_update.js diff --git a/vendor/_attachments/jquery.couch.app.js b/couchapp/templates/vendor/_attachments/jquery.couch.app.js similarity index 100% rename from vendor/_attachments/jquery.couch.app.js rename to couchapp/templates/vendor/_attachments/jquery.couch.app.js diff --git a/vendor/_attachments/jquery.couch.app.util.js b/couchapp/templates/vendor/_attachments/jquery.couch.app.util.js similarity index 100% rename from vendor/_attachments/jquery.couch.app.util.js rename to couchapp/templates/vendor/_attachments/jquery.couch.app.util.js diff --git a/vendor/_attachments/jquery.evently.js b/couchapp/templates/vendor/_attachments/jquery.evently.js similarity index 100% rename from vendor/_attachments/jquery.evently.js rename to couchapp/templates/vendor/_attachments/jquery.evently.js diff --git a/vendor/_attachments/jquery.mustache.js b/couchapp/templates/vendor/_attachments/jquery.mustache.js similarity index 100% rename from vendor/_attachments/jquery.mustache.js rename to couchapp/templates/vendor/_attachments/jquery.mustache.js diff --git a/vendor/_attachments/jquery.pathbinder.js b/couchapp/templates/vendor/_attachments/jquery.pathbinder.js similarity index 100% rename from vendor/_attachments/jquery.pathbinder.js rename to couchapp/templates/vendor/_attachments/jquery.pathbinder.js diff --git a/vendor/_attachments/loader.js b/couchapp/templates/vendor/_attachments/loader.js similarity index 100% rename from vendor/_attachments/loader.js rename to couchapp/templates/vendor/_attachments/loader.js diff --git a/vendor/evently/README.md b/couchapp/templates/vendor/evently/README.md similarity index 100% rename from vendor/evently/README.md rename to couchapp/templates/vendor/evently/README.md diff --git a/vendor/evently/account/_init.js b/couchapp/templates/vendor/evently/account/_init.js similarity index 100% rename from vendor/evently/account/_init.js rename to couchapp/templates/vendor/evently/account/_init.js diff --git a/vendor/evently/account/adminParty/mustache.html b/couchapp/templates/vendor/evently/account/adminParty/mustache.html similarity index 100% rename from vendor/evently/account/adminParty/mustache.html rename to couchapp/templates/vendor/evently/account/adminParty/mustache.html diff --git a/vendor/evently/account/doLogin.js b/couchapp/templates/vendor/evently/account/doLogin.js similarity index 100% rename from vendor/evently/account/doLogin.js rename to couchapp/templates/vendor/evently/account/doLogin.js diff --git a/vendor/evently/account/doLogout.js b/couchapp/templates/vendor/evently/account/doLogout.js similarity index 100% rename from vendor/evently/account/doLogout.js rename to couchapp/templates/vendor/evently/account/doLogout.js diff --git a/vendor/evently/account/doSignup.js b/couchapp/templates/vendor/evently/account/doSignup.js similarity index 100% rename from vendor/evently/account/doSignup.js rename to couchapp/templates/vendor/evently/account/doSignup.js diff --git a/vendor/evently/account/loggedIn/after.js b/couchapp/templates/vendor/evently/account/loggedIn/after.js similarity index 100% rename from vendor/evently/account/loggedIn/after.js rename to couchapp/templates/vendor/evently/account/loggedIn/after.js diff --git a/vendor/evently/account/loggedIn/data.js b/couchapp/templates/vendor/evently/account/loggedIn/data.js similarity index 100% rename from vendor/evently/account/loggedIn/data.js rename to couchapp/templates/vendor/evently/account/loggedIn/data.js diff --git a/vendor/evently/account/loggedIn/mustache.html b/couchapp/templates/vendor/evently/account/loggedIn/mustache.html similarity index 100% rename from vendor/evently/account/loggedIn/mustache.html rename to couchapp/templates/vendor/evently/account/loggedIn/mustache.html diff --git a/vendor/evently/account/loggedIn/selectors.json b/couchapp/templates/vendor/evently/account/loggedIn/selectors.json similarity index 100% rename from vendor/evently/account/loggedIn/selectors.json rename to couchapp/templates/vendor/evently/account/loggedIn/selectors.json diff --git a/vendor/evently/account/loggedOut/mustache.html b/couchapp/templates/vendor/evently/account/loggedOut/mustache.html similarity index 100% rename from vendor/evently/account/loggedOut/mustache.html rename to couchapp/templates/vendor/evently/account/loggedOut/mustache.html diff --git a/vendor/evently/account/loggedOut/selectors.json b/couchapp/templates/vendor/evently/account/loggedOut/selectors.json similarity index 100% rename from vendor/evently/account/loggedOut/selectors.json rename to couchapp/templates/vendor/evently/account/loggedOut/selectors.json diff --git a/vendor/evently/account/loginForm/after.js b/couchapp/templates/vendor/evently/account/loginForm/after.js similarity index 100% rename from vendor/evently/account/loginForm/after.js rename to couchapp/templates/vendor/evently/account/loginForm/after.js diff --git a/vendor/evently/account/loginForm/mustache.html b/couchapp/templates/vendor/evently/account/loginForm/mustache.html similarity index 100% rename from vendor/evently/account/loginForm/mustache.html rename to couchapp/templates/vendor/evently/account/loginForm/mustache.html diff --git a/vendor/evently/account/loginForm/selectors/a[href=#signup].json b/couchapp/templates/vendor/evently/account/loginForm/selectors/a[href=#signup].json similarity index 100% rename from vendor/evently/account/loginForm/selectors/a[href=#signup].json rename to couchapp/templates/vendor/evently/account/loginForm/selectors/a[href=#signup].json diff --git a/vendor/evently/account/loginForm/selectors/form/submit.js b/couchapp/templates/vendor/evently/account/loginForm/selectors/form/submit.js similarity index 100% rename from vendor/evently/account/loginForm/selectors/form/submit.js rename to couchapp/templates/vendor/evently/account/loginForm/selectors/form/submit.js diff --git a/vendor/evently/account/signupForm/after.js b/couchapp/templates/vendor/evently/account/signupForm/after.js similarity index 100% rename from vendor/evently/account/signupForm/after.js rename to couchapp/templates/vendor/evently/account/signupForm/after.js diff --git a/vendor/evently/account/signupForm/mustache.html b/couchapp/templates/vendor/evently/account/signupForm/mustache.html similarity index 100% rename from vendor/evently/account/signupForm/mustache.html rename to couchapp/templates/vendor/evently/account/signupForm/mustache.html diff --git a/vendor/evently/account/signupForm/selectors/a[href=#login].json b/couchapp/templates/vendor/evently/account/signupForm/selectors/a[href=#login].json similarity index 100% rename from vendor/evently/account/signupForm/selectors/a[href=#login].json rename to couchapp/templates/vendor/evently/account/signupForm/selectors/a[href=#login].json diff --git a/vendor/evently/account/signupForm/selectors/form/submit.js b/couchapp/templates/vendor/evently/account/signupForm/selectors/form/submit.js similarity index 100% rename from vendor/evently/account/signupForm/selectors/form/submit.js rename to couchapp/templates/vendor/evently/account/signupForm/selectors/form/submit.js diff --git a/vendor/evently/profile/loggedIn.js b/couchapp/templates/vendor/evently/profile/loggedIn.js similarity index 100% rename from vendor/evently/profile/loggedIn.js rename to couchapp/templates/vendor/evently/profile/loggedIn.js diff --git a/vendor/evently/profile/loggedOut/after.js b/couchapp/templates/vendor/evently/profile/loggedOut/after.js similarity index 100% rename from vendor/evently/profile/loggedOut/after.js rename to couchapp/templates/vendor/evently/profile/loggedOut/after.js diff --git a/vendor/evently/profile/loggedOut/mustache.html b/couchapp/templates/vendor/evently/profile/loggedOut/mustache.html similarity index 100% rename from vendor/evently/profile/loggedOut/mustache.html rename to couchapp/templates/vendor/evently/profile/loggedOut/mustache.html diff --git a/vendor/evently/profile/noProfile/data.js b/couchapp/templates/vendor/evently/profile/noProfile/data.js similarity index 100% rename from vendor/evently/profile/noProfile/data.js rename to couchapp/templates/vendor/evently/profile/noProfile/data.js diff --git a/vendor/evently/profile/noProfile/mustache.html b/couchapp/templates/vendor/evently/profile/noProfile/mustache.html similarity index 100% rename from vendor/evently/profile/noProfile/mustache.html rename to couchapp/templates/vendor/evently/profile/noProfile/mustache.html diff --git a/vendor/evently/profile/noProfile/selectors/form/submit.js b/couchapp/templates/vendor/evently/profile/noProfile/selectors/form/submit.js similarity index 100% rename from vendor/evently/profile/noProfile/selectors/form/submit.js rename to couchapp/templates/vendor/evently/profile/noProfile/selectors/form/submit.js diff --git a/vendor/evently/profile/profileReady/after.js b/couchapp/templates/vendor/evently/profile/profileReady/after.js similarity index 100% rename from vendor/evently/profile/profileReady/after.js rename to couchapp/templates/vendor/evently/profile/profileReady/after.js diff --git a/vendor/evently/profile/profileReady/data.js b/couchapp/templates/vendor/evently/profile/profileReady/data.js similarity index 100% rename from vendor/evently/profile/profileReady/data.js rename to couchapp/templates/vendor/evently/profile/profileReady/data.js diff --git a/vendor/evently/profile/profileReady/mustache.html b/couchapp/templates/vendor/evently/profile/profileReady/mustache.html similarity index 100% rename from vendor/evently/profile/profileReady/mustache.html rename to couchapp/templates/vendor/evently/profile/profileReady/mustache.html diff --git a/vendor/lib/atom.js b/couchapp/templates/vendor/lib/atom.js similarity index 100% rename from vendor/lib/atom.js rename to couchapp/templates/vendor/lib/atom.js diff --git a/vendor/lib/cache.js b/couchapp/templates/vendor/lib/cache.js similarity index 100% rename from vendor/lib/cache.js rename to couchapp/templates/vendor/lib/cache.js diff --git a/vendor/lib/code.js b/couchapp/templates/vendor/lib/code.js similarity index 100% rename from vendor/lib/code.js rename to couchapp/templates/vendor/lib/code.js diff --git a/vendor/lib/docform.js b/couchapp/templates/vendor/lib/docform.js similarity index 100% rename from vendor/lib/docform.js rename to couchapp/templates/vendor/lib/docform.js diff --git a/vendor/lib/linkup.js b/couchapp/templates/vendor/lib/linkup.js similarity index 100% rename from vendor/lib/linkup.js rename to couchapp/templates/vendor/lib/linkup.js diff --git a/vendor/lib/list.js b/couchapp/templates/vendor/lib/list.js similarity index 100% rename from vendor/lib/list.js rename to couchapp/templates/vendor/lib/list.js diff --git a/vendor/lib/markdown.js b/couchapp/templates/vendor/lib/markdown.js similarity index 100% rename from vendor/lib/markdown.js rename to couchapp/templates/vendor/lib/markdown.js diff --git a/vendor/lib/md5.js b/couchapp/templates/vendor/lib/md5.js similarity index 100% rename from vendor/lib/md5.js rename to couchapp/templates/vendor/lib/md5.js diff --git a/vendor/lib/mustache.js b/couchapp/templates/vendor/lib/mustache.js similarity index 100% rename from vendor/lib/mustache.js rename to couchapp/templates/vendor/lib/mustache.js diff --git a/vendor/lib/path.js b/couchapp/templates/vendor/lib/path.js similarity index 100% rename from vendor/lib/path.js rename to couchapp/templates/vendor/lib/path.js diff --git a/vendor/lib/redirect.js b/couchapp/templates/vendor/lib/redirect.js similarity index 100% rename from vendor/lib/redirect.js rename to couchapp/templates/vendor/lib/redirect.js diff --git a/vendor/lib/utils.js b/couchapp/templates/vendor/lib/utils.js similarity index 100% rename from vendor/lib/utils.js rename to couchapp/templates/vendor/lib/utils.js diff --git a/vendor/lib/validate.js b/couchapp/templates/vendor/lib/validate.js similarity index 100% rename from vendor/lib/validate.js rename to couchapp/templates/vendor/lib/validate.js diff --git a/vendor/metadata.json b/couchapp/templates/vendor/metadata.json similarity index 54% rename from vendor/metadata.json rename to couchapp/templates/vendor/metadata.json index d54a5e46..17662486 100644 --- a/vendor/metadata.json +++ b/couchapp/templates/vendor/metadata.json @@ -1,5 +1,5 @@ { "name": "couchapp", "description": "official couchapp vendor", - "fetch_uri": "git://github.com/couchapp/couchapp.git" -} \ No newline at end of file + "fetch_uri": "git://github.com/couchapp/vendor.git" +} diff --git a/couchapp/util.py b/couchapp/util.py index dc7865c0..2888c9c6 100644 --- a/couchapp/util.py +++ b/couchapp/util.py @@ -9,12 +9,11 @@ from hashlib import md5 import logging import os -import pkg_resources import re import string import sys -from couchapp.errors import ScriptError, AppError +from .errors import ScriptError, AppError try: import json @@ -385,23 +384,12 @@ def __call__(self, *args, **options): def parse_uri(uri, section): - if uri.startswith("egg:"): - # uses entry points - entry_str = uri.split("egg:")[1] - try: - dist, name = entry_str.rsplit("#",1) - except ValueError: - dist = entry_str - name = "main" - - return pkg_resources.load_entry_point(dist, section, name) - elif uri.startswith("python:"): + if uri.startswith("python:"): uri1 = uri.split("python:")[1] - components = uri1.split('.') - if len(components) == 1: - raise RuntimeError("extension uri invalid") - klass = components.pop(-1) - mod = __import__('.'.join(components)) + module_str, klass = uri1.split("#") + components = module_str.split('.') + + mod = __import__(module_str) for comp in components[1:]: mod = getattr(mod, comp) return getattr(mod, klass) @@ -409,7 +397,7 @@ def parse_uri(uri, section): raise RuntimeError("extension uri invalid") def parse_hooks_uri(uri): - if uri.startswith("python:") or uri.startswith("egg:"): + if uri.startswith("python:"): return parse_uri(uri, "couchapp.hook") return ShellScript(uri) diff --git a/couchapp/util.pyo b/couchapp/util.pyo new file mode 100644 index 00000000..db874259 Binary files /dev/null and b/couchapp/util.pyo differ diff --git a/couchapp/vendors/__init__.pyo b/couchapp/vendors/__init__.pyo new file mode 100644 index 00000000..432284b8 Binary files /dev/null and b/couchapp/vendors/__init__.pyo differ diff --git a/couchapp/vendors/base.pyo b/couchapp/vendors/base.pyo new file mode 100644 index 00000000..50e5cf59 Binary files /dev/null and b/couchapp/vendors/base.pyo differ diff --git a/resources/scripts/couchapp b/resources/scripts/couchapp index 578ec9ad..f0dca8ff 100755 --- a/resources/scripts/couchapp +++ b/resources/scripts/couchapp @@ -1,7 +1,9 @@ -#!/usr/bin/env sh +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# # This file is part of couchapp released under the Apache 2 license. # See the NOTICE for more information. -PYTHON_BIN=`which python` +from couchapp.dispatch import run -$PYTHON_BIN -OO -c "import couchapp.dispatch" +run() diff --git a/resources/scripts/couchapp.bat b/resources/scripts/couchapp.bat index 8da2d461..a2009abf 100755 --- a/resources/scripts/couchapp.bat +++ b/resources/scripts/couchapp.bat @@ -2,4 +2,4 @@ REM This file is part of couchapp released under the Apache 2 license. REM See the NOTICE for more information. -pythonw.exe -OO -c "import couchapp:dispatch" +pythonw.exe -OO -c "import couchapp:dispatch" %* diff --git a/resources/scripts/couchapp.py b/resources/scripts/couchapp.py deleted file mode 100755 index aaef158e..00000000 --- a/resources/scripts/couchapp.py +++ /dev/null @@ -1,6 +0,0 @@ -# -*- coding: utf-8 -*- -# -# This file is part of couchapp released under the Apache 2 license. -# See the NOTICE for more information. - -__import__("couchapp.dispatch") diff --git a/setup.py b/setup.py index 91f83da5..69eef8b4 100644 --- a/setup.py +++ b/setup.py @@ -3,70 +3,42 @@ # This file is part of couchapp released under the Apache 2 license. # See the NOTICE for more information. -from distutils.command.install_data import install_data from distutils.core import setup import os import sys +from couchapp import __version__ + if not hasattr(sys, 'version_info') or sys.version_info < (2, 5, 0, 'final'): raise SystemExit("Couchapp requires Python 2.5 or later.") - +executables = [] setup_requires = [] extra = {} -class install_package_data(install_data): - def finalize_options(self): - self.set_undefined_options('install', - ('install_lib', 'install_dir')) - install_data.finalize_options(self) - -cmdclass = {'install_data': install_package_data } - def get_data_files(): data_files = [] - data_files.append((os.curdir, ["LICENSE", "MANIFEST.in", "NOTICE", "README.md", "THANKS.txt",])) + return data_files - for root in ('templates', 'vendor'): - for dir, dirs, files in os.walk(root): - dirs[:] = [x for x in dirs if not x.startswith('.')] - files = [x for x in files if not x.startswith('.')] - data_files.append((os.path.join('couchapp', dir), - [os.path.join(dir, file_) for file_ in files])) - -def get_include_files(): - include_files = [] - - data_path_src = os.curdir - data_path_dst = os.curdir - - filelist = ["LICENSE", "MANIFEST.in", "NOTICE", "README.md", - "THANKS.txt",] - - for fl in filelist: - include_files.append((os.path.join(data_path_src, fl), - os.path.join(data_path_dst, fl))) - - for root in ('templates', 'vendor'): - for dir, dirs, files in os.walk(root): - dirs[:] = [x for x in dirs if not x.startswith('.')] - files = [x for x in files if not x.startswith('.')] - - for f in files: - src = os.path.join(dir, f) - include_files.append((src, src)) +def ordinarypath(p): + return p and p[0] != '.' and p[-1] != '~' def get_packages_data(): - return { - "couchapp": [ - "templates/*", - "vendor/*" - ] - } + packagedata = {'couchapp': []} + + for root in ('templates',): + for curdir, dirs, files in os.walk(os.path.join("couchapp", root)): + print curdir + curdir = curdir.split(os.sep, 1)[1] + dirs[:] = filter(ordinarypath, dirs) + for f in filter(ordinarypath, files): + f = os.path.join(curdir, f) + packagedata['couchapp'].append(f) + return packagedata def all_packages(): return [ @@ -89,6 +61,7 @@ def get_scripts(): return [os.path.join("resources", "scripts", "couchapp")] return [os.path.join("resources", "scripts", "couchapp.bat")] +Executable = None if os.name == "nt" or sys.platform == "win32": # py2exe needs to be installed to work try: @@ -113,19 +86,19 @@ def get_scripts(): if len(sys.argv) == 1: sys.argv.append("py2exe") sys.argv.append("-q") - Executable = lambda x, *y, **z: x - setup_requires = ["py2exe"] + + extra['console'] = [{ + 'script': os.path.join("resources", "scripts", "couchapp"), + 'copyright':'Copyright (C) 2008-2011 BenoƮt Chesneau and others', + 'product_version': __version__ + }] + except ImportError: raise SystemExit('You need py2exe installed to run Couchapp.') -elif sys.platform == "linux2": - import cx_Freeze - from cx_Freeze import setup, Executable - setup_requires = ["cx_Freeze"] -from couchapp import __version__ setup( name = 'Couchapp', @@ -153,68 +126,23 @@ def get_scripts(): ], packages = all_packages(), - packages_data = get_packages_data(), + package_data = get_packages_data(), data_files=get_data_files(), - include_package_data = True, - - cmdclass=cmdclass, scripts=get_scripts(), - executables=[ - Executable( - "Couchapp.py", - compress=1, - copyDependentFiles=True) - ], - options = dict(py2exe={ - 'compressed': 1, - 'optimize': 2, - "ascii": 1, - "excludes": [ - "pywin", - "pywin.debugger", - "pywin.debugger.dbgcon", - "pywin.dialogs", - "pywin.dialogs.list", - ], 'dll_excludes': [ "kernelbase.dll", "powrprof.dll" ] }, - build_exe={ - "compressed": 1, - "optimize": 2, - "include_files": get_include_files(), - "create_shared_zip": 1, - "include_in_shared_zip": get_include_files() - }, - bdist_mpkg=dict(zipdist=True, license='LICENSE', readme='resources/macosx/Readme.html', welcome='resources/macosx/Welcome.html') ), - - entry_points=""" - [couchapp.extension] - autopush=couchapp.ext.autopush - - [couchapp.vendor] - git=couchapp.vendors.backends.git:GitVendor - hg=couchapp.vendors.backends.hg:HgVendor - couchdb=couchapp.vendors.backends.couchdb:CouchdbVendor - - [couchapp.hook] - compress=couchapp.hooks.compress:hook - - [console_scripts] - couchapp=couchapp.dispatch:run - """, - - setup_requires=setup_requires, + **extra )