diff options
28 files changed, 642 insertions, 75 deletions
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -278,7 +278,7 @@ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest diff --git a/pylons_app/__init__.py b/pylons_app/__init__.py index a5f5b6c3..057135ce 100644 --- a/pylons_app/__init__.py +++ b/pylons_app/__init__.py @@ -1,5 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Hg app, a web based mercurial repository managment based on pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + """ +Created on April 9, 2010 Hg app, a web based mercurial repository managment based on pylons +@author: marcink """ VERSION = (0, 7, 6, 'beta') diff --git a/pylons_app/config/environment.py b/pylons_app/config/environment.py index 962b60e7..ef89c82f 100644 --- a/pylons_app/config/environment.py +++ b/pylons_app/config/environment.py @@ -4,6 +4,7 @@ from pylons.configuration import PylonsConfig from pylons.error import handle_mako_error from pylons_app.config.routing import make_map from pylons_app.lib.auth import set_available_permissions +from pylons_app.lib.utils import repo2db_mapper from pylons_app.model import init_model from sqlalchemy import engine_from_config import logging @@ -11,8 +12,6 @@ import os import pylons_app.lib.app_globals as app_globals import pylons_app.lib.helpers - - log = logging.getLogger(__name__) def load_environment(global_conf, app_conf): @@ -39,7 +38,6 @@ def load_environment(global_conf, app_conf): import pylons pylons.cache._push_object(config['pylons.app_globals'].cache) - # Create the Mako TemplateLookup, with the default auto-escaping config['pylons.app_globals'].mako_lookup = TemplateLookup( directories=paths['templates'], @@ -48,7 +46,7 @@ def load_environment(global_conf, app_conf): input_encoding='utf-8', default_filters=['escape'], imports=['from webhelpers.html import escape']) - #sets the c attribute access when don't existing attribute ar accessed + #sets the c attribute access when don't existing attribute are accessed config['pylons.strict_tmpl_context'] = True #MULTIPLE DB configs @@ -62,7 +60,7 @@ def load_environment(global_conf, app_conf): sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.') init_model(sa_engine_db1) - + repo2db_mapper() set_available_permissions(config) # CONFIGURATION OPTIONS HERE (note: all config options will override # any Pylons config options) diff --git a/pylons_app/controllers/admin.py b/pylons_app/controllers/admin.py index 30f6afb8..52079611 100644 --- a/pylons_app/controllers/admin.py +++ b/pylons_app/controllers/admin.py @@ -1,6 +1,29 @@ +#!/usr/bin/env python +# encoding: utf-8 +# admin controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 7, 2010 +admin controller for pylons +@author: marcink +""" import logging -from pylons import request, response, session, tmpl_context as c, url, app_globals as g -from pylons.controllers.util import abort, redirect +from pylons import request, response, session, tmpl_context as c from pylons_app.lib.base import BaseController, render from pylons_app.model import meta from pylons_app.model.db import UserLog diff --git a/pylons_app/controllers/branches.py b/pylons_app/controllers/branches.py index cb65337e..37f183ad 100644 --- a/pylons_app/controllers/branches.py +++ b/pylons_app/controllers/branches.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# branches controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 21, 2010 +branches controller for pylons +@author: marcink +""" from pylons import tmpl_context as c, app_globals as g from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render diff --git a/pylons_app/controllers/changelog.py b/pylons_app/controllers/changelog.py index 19fede32..bb49444b 100644 --- a/pylons_app/controllers/changelog.py +++ b/pylons_app/controllers/changelog.py @@ -1,11 +1,31 @@ -from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET -from mercurial.node import short +#!/usr/bin/env python +# encoding: utf-8 +# changelog controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 21, 2010 +changelog controller for pylons +@author: marcink +""" from pylons import request, session, tmpl_context as c from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render -from pylons_app.lib.filters import age as _age, person from pylons_app.model.hg_model import _full_changelog_cached -from simplejson import dumps from webhelpers.paginate import Page import logging log = logging.getLogger(__name__) @@ -43,32 +63,33 @@ class ChangelogController(BaseController): def _graph(self, repo, size, p): - revcount = size - if not repo.revisions:return dumps([]), 0 - - max_rev = repo.revisions[-1] - offset = 1 if p == 1 else ((p - 1) * revcount) - rev_start = repo.revisions[(-1 * offset)] - c.bg_height = 120 - - revcount = min(max_rev, revcount) - rev_end = max(0, rev_start - revcount) - dag = graph_rev(repo.repo, rev_start, rev_end) - - c.dag = tree = list(colored(dag)) - canvasheight = (len(tree) + 1) * c.bg_height - 27 - data = [] - for (id, type, ctx, vtx, edges) in tree: - if type != CHANGESET: - continue - node = short(ctx.node()) - age = _age(ctx.date()) - desc = ctx.description() - user = person(ctx.user()) - branch = ctx.branch() - branch = branch, repo.repo.branchtags().get(branch) == ctx.node() - data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) - - c.jsdata = dumps(data) - c.canvasheight = canvasheight + pass +# revcount = size +# if not repo.revisions:return dumps([]), 0 +# +# max_rev = repo.revisions[-1] +# offset = 1 if p == 1 else ((p - 1) * revcount) +# rev_start = repo.revisions[(-1 * offset)] +# c.bg_height = 120 +# +# revcount = min(max_rev, revcount) +# rev_end = max(0, rev_start - revcount) +# dag = graph_rev(repo.repo, rev_start, rev_end) +# +# c.dag = tree = list(colored(dag)) +# canvasheight = (len(tree) + 1) * c.bg_height - 27 +# data = [] +# for (id, type, ctx, vtx, edges) in tree: +# if type != CHANGESET: +# continue +# node = short(ctx.node()) +# age = _age(ctx.date()) +# desc = ctx.description() +# user = person(ctx.user()) +# branch = ctx.branch() +# branch = branch, repo.repo.branchtags().get(branch) == ctx.node() +# data.append((node, vtx, edges, desc, user, age, branch, ctx.tags())) +# +# c.jsdata = dumps(data) +# c.canvasheight = canvasheight diff --git a/pylons_app/controllers/changeset.py b/pylons_app/controllers/changeset.py index ef1dde55..58fa1a23 100644 --- a/pylons_app/controllers/changeset.py +++ b/pylons_app/controllers/changeset.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# changeset controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 25, 2010 +changeset controller for pylons +@author: marcink +""" from pylons import tmpl_context as c from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render diff --git a/pylons_app/controllers/feed.py b/pylons_app/controllers/feed.py index 251739a7..31f19695 100644 --- a/pylons_app/controllers/feed.py +++ b/pylons_app/controllers/feed.py @@ -1,5 +1,27 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python +# encoding: utf-8 +# feed controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 23, 2010 +feed controller for pylons +@author: marcink +""" from pylons import tmpl_context as c, url, response from pylons_app.lib.base import BaseController, render from pylons_app.model.hg_model import _full_changelog_cached diff --git a/pylons_app/controllers/files.py b/pylons_app/controllers/files.py index af755c33..af3b3c63 100644 --- a/pylons_app/controllers/files.py +++ b/pylons_app/controllers/files.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# files controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 21, 2010 +files controller for pylons +@author: marcink +""" from mercurial import archival from pylons import request, response, session, tmpl_context as c, url from pylons_app.lib.auth import LoginRequired diff --git a/pylons_app/controllers/graph.py b/pylons_app/controllers/graph.py index fbc6f0ae..6489b3a3 100644 --- a/pylons_app/controllers/graph.py +++ b/pylons_app/controllers/graph.py @@ -1,20 +1,38 @@ +#!/usr/bin/env python +# encoding: utf-8 +# graph controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 21, 2010 +graph controller for pylons +@author: marcink +""" from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET from mercurial.node import short -from pylons import request, response, session, tmpl_context as c, url, config, \ - app_globals as g -from pylons.controllers.util import abort, redirect +from pylons import request, tmpl_context as c from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render from pylons_app.lib.filters import age as _age, person -from pylons_app.lib.utils import get_repo_slug from pylons_app.model.hg_model import HgModel from simplejson import dumps from webhelpers.paginate import Page import logging - - - log = logging.getLogger(__name__) class GraphController(BaseController): diff --git a/pylons_app/controllers/hg.py b/pylons_app/controllers/hg.py index ba9b095e..8acd13d1 100644 --- a/pylons_app/controllers/hg.py +++ b/pylons_app/controllers/hg.py @@ -1,7 +1,29 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- +#!/usr/bin/env python +# encoding: utf-8 +# hg controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on February 18, 2010 +hg controller for pylons +@author: marcink +""" from operator import itemgetter -from pylons import tmpl_context as c, request, config +from pylons import tmpl_context as c, request from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render from pylons_app.model.hg_model import HgModel diff --git a/pylons_app/controllers/login.py b/pylons_app/controllers/login.py index ec89486e..1b029602 100644 --- a/pylons_app/controllers/login.py +++ b/pylons_app/controllers/login.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# login controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 22, 2010 +login controller for pylons +@author: marcink +""" import logging from formencode import htmlfill from pylons import request, response, session, tmpl_context as c, url diff --git a/pylons_app/controllers/permissions.py b/pylons_app/controllers/permissions.py index bb90c599..011d7956 100644 --- a/pylons_app/controllers/permissions.py +++ b/pylons_app/controllers/permissions.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# permissions controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 27, 2010 +permissions controller for pylons +@author: marcink +""" import logging from pylons import request, response, session, tmpl_context as c, url diff --git a/pylons_app/controllers/repos.py b/pylons_app/controllers/repos.py index 59137b78..77f40508 100644 --- a/pylons_app/controllers/repos.py +++ b/pylons_app/controllers/repos.py @@ -1,3 +1,28 @@ +#!/usr/bin/env python +# encoding: utf-8 +# repos controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 7, 2010 +admin controller for pylons +@author: marcink +""" +import logging from pylons import request, response, session, tmpl_context as c, url, \ app_globals as g from pylons.controllers.util import abort, redirect @@ -8,7 +33,6 @@ from pylons_app.lib.base import BaseController, render from pylons_app.lib.filters import clean_repo from pylons_app.lib.utils import check_repo, invalidate_cache from pylons_app.model.hg_model import HgModel -import logging import os import shutil from operator import itemgetter diff --git a/pylons_app/controllers/shortlog.py b/pylons_app/controllers/shortlog.py index fe7730f3..1e31dce3 100644 --- a/pylons_app/controllers/shortlog.py +++ b/pylons_app/controllers/shortlog.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# shortlog controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 18, 2010 +shortlog controller for pylons +@author: marcink +""" from pylons import tmpl_context as c, request from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render diff --git a/pylons_app/controllers/summary.py b/pylons_app/controllers/summary.py index 691093a0..331ee71f 100644 --- a/pylons_app/controllers/summary.py +++ b/pylons_app/controllers/summary.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# summary controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 18, 2010 +summary controller for pylons +@author: marcink +""" from pylons import tmpl_context as c, request from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render diff --git a/pylons_app/controllers/tags.py b/pylons_app/controllers/tags.py index 79d3f66c..e705e46b 100644 --- a/pylons_app/controllers/tags.py +++ b/pylons_app/controllers/tags.py @@ -1,3 +1,27 @@ +#!/usr/bin/env python +# encoding: utf-8 +# tags controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 21, 2010 +tags controller for pylons +@author: marcink +""" from pylons import tmpl_context as c from pylons_app.lib.auth import LoginRequired from pylons_app.lib.base import BaseController, render diff --git a/pylons_app/controllers/users.py b/pylons_app/controllers/users.py index 06f166b7..0c73b871 100644 --- a/pylons_app/controllers/users.py +++ b/pylons_app/controllers/users.py @@ -1,3 +1,28 @@ +#!/usr/bin/env python +# encoding: utf-8 +# users controller for pylons +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 4, 2010 +users controller for pylons +@author: marcink +""" +import logging from formencode import htmlfill from pylons import request, session, tmpl_context as c, url from pylons.controllers.util import abort, redirect @@ -9,7 +34,6 @@ from pylons_app.model.db import User, UserLog from pylons_app.model.forms import UserForm from pylons_app.model.user_model import UserModel import formencode -import logging log = logging.getLogger(__name__) diff --git a/pylons_app/lib/auth.py b/pylons_app/lib/auth.py index e9993486..71574c8b 100644 --- a/pylons_app/lib/auth.py +++ b/pylons_app/lib/auth.py @@ -1,3 +1,28 @@ +#!/usr/bin/env python +# encoding: utf-8 +# authentication and permission libraries +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 4, 2010 + +@author: marcink +""" + from functools import wraps from pylons import session, url, app_globals as g from pylons.controllers.util import abort, redirect diff --git a/pylons_app/lib/backup_manager.py b/pylons_app/lib/backup_manager.py index 85035bbf..eec6697e 100644 --- a/pylons_app/lib/backup_manager.py +++ b/pylons_app/lib/backup_manager.py @@ -1,4 +1,30 @@ -'''BACKUP MANAGER''' +#!/usr/bin/env python +# encoding: utf-8 +# mercurial repository backup manager +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + +""" +Created on Feb 28, 2010 +Mercurial repositories backup manager +@author: marcink +""" + + import logging from mercurial import config import tarfile diff --git a/pylons_app/lib/db_manage.py b/pylons_app/lib/db_manage.py index 386117c7..638087a5 100644 --- a/pylons_app/lib/db_manage.py +++ b/pylons_app/lib/db_manage.py @@ -1,3 +1,29 @@ +#!/usr/bin/env python +# encoding: utf-8 +# database managment for hg app +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + +""" +Created on April 10, 2010 +database managment and creation for hg app +@author: marcink +""" + from os.path import dirname as dn, join as jn import os import sys diff --git a/pylons_app/lib/filters.py b/pylons_app/lib/filters.py index 171bf762..90bc9de0 100644 --- a/pylons_app/lib/filters.py +++ b/pylons_app/lib/filters.py @@ -1,3 +1,29 @@ +#!/usr/bin/env python +# encoding: utf-8 +# simple filters for hg apps html templates +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + +""" +Created on April 12, 2010 +simple filters for hg apps html templates +@author: marcink +""" + from mercurial import util from mercurial.templatefilters import age as _age, person as _person from string import punctuation diff --git a/pylons_app/lib/middleware/https_fixup.py b/pylons_app/lib/middleware/https_fixup.py index 84bf3066..3e3233b5 100644 --- a/pylons_app/lib/middleware/https_fixup.py +++ b/pylons_app/lib/middleware/https_fixup.py @@ -1,3 +1,29 @@ +#!/usr/bin/env python +# encoding: utf-8 +# middleware to handle https correctly +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + +""" +Created on May 23, 2010 + +@author: marcink +""" + class HttpsFixup(object): def __init__(self, app): self.application = app diff --git a/pylons_app/lib/middleware/simplehg.py b/pylons_app/lib/middleware/simplehg.py index 8835e356..26c54029 100644 --- a/pylons_app/lib/middleware/simplehg.py +++ b/pylons_app/lib/middleware/simplehg.py @@ -1,8 +1,23 @@ #!/usr/bin/env python # encoding: utf-8 -# -# Copyright (c) 2010 marcink. All rights reserved. -# +# middleware to handle mercurial api calls +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + """ Created on 2010-04-28 diff --git a/pylons_app/lib/utils.py b/pylons_app/lib/utils.py index 9922f7f5..70618a32 100644 --- a/pylons_app/lib/utils.py +++ b/pylons_app/lib/utils.py @@ -1,3 +1,29 @@ +#!/usr/bin/env python +# encoding: utf-8 +# Utilities for hg app +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. + +""" +Created on April 18, 2010 +Utilities for hg app +@author: marcink +""" + import os import logging from mercurial import ui, config, hg @@ -131,4 +157,4 @@ def repo2db_mapper(): scann all dirs for .hgdbid if some dir doesn't have one generate one. """ - pass
\ No newline at end of file + pass diff --git a/pylons_app/model/hg_model.py b/pylons_app/model/hg_model.py index f642baa3..9fd2c975 100644 --- a/pylons_app/model/hg_model.py +++ b/pylons_app/model/hg_model.py @@ -1,13 +1,28 @@ #!/usr/bin/env python # encoding: utf-8 -# -# Copyright (c) 2010 marcink. All rights reserved. -# -''' -Created on Apr 9, 2010 +# Model for hg app +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 9, 2010 +Model for hg app @author: marcink -''' +""" from beaker.cache import cache_region from mercurial import ui diff --git a/pylons_app/model/user_model.py b/pylons_app/model/user_model.py index 62ca3630..95c6521a 100644 --- a/pylons_app/model/user_model.py +++ b/pylons_app/model/user_model.py @@ -1,15 +1,31 @@ #!/usr/bin/env python # encoding: utf-8 -# -# Copyright (c) 2010 marcink. All rights reserved. -# -from pylons_app.model.db import User -from pylons_app.model.meta import Session -''' -Created on Apr 9, 2010 +# Model for users +# Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com> + +# 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; version 2 +# of the License or (at your opinion) any later version of the license. +# +# 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. +""" +Created on April 9, 2010 +Model for users @author: marcink -''' +""" + +from pylons_app.model.db import User +from pylons_app.model.meta import Session class UserModel(object): diff --git a/pylons_app/templates/admin/permissions/permissions.html b/pylons_app/templates/admin/permissions/permissions.html index 8cac5996..ba11da09 100644 --- a/pylons_app/templates/admin/permissions/permissions.html +++ b/pylons_app/templates/admin/permissions/permissions.html @@ -16,6 +16,6 @@ <%def name="main()"> <div> <h2>${_('Permissions')}</h2> - todo :) + </div> </%def> |