##// END OF EJS Templates
licensing updates, code cleanups
marcink -
r252:3782a6d6 default
parent child Browse files
Show More
@@ -168,7 +168,7 b' access to copy from a designated place, '
168 168 access to copy the source code from the same place counts as
169 169 distribution of the source code, even though third parties are not
170 170 compelled to copy the source along with the object code.
171
171
172 172 4. You may not copy, modify, sublicense, or distribute the Program
173 173 except as expressly provided under this License. Any attempt
174 174 otherwise to copy, modify, sublicense or distribute the Program is
@@ -278,7 +278,7 b' PROGRAMS), EVEN IF SUCH HOLDER OR OTHER '
278 278 POSSIBILITY OF SUCH DAMAGES.
279 279
280 280 END OF TERMS AND CONDITIONS
281
281
282 282 How to Apply These Terms to Your New Programs
283 283
284 284 If you develop a new program, and you want it to be of the greatest
@@ -1,5 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Hg app, a web based mercurial repository managment based on pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
1 21 """
22 Created on April 9, 2010
2 23 Hg app, a web based mercurial repository managment based on pylons
24 @author: marcink
3 25 """
4 26
5 27 VERSION = (0, 7, 6, 'beta')
@@ -4,6 +4,7 b' from pylons.configuration import PylonsC'
4 4 from pylons.error import handle_mako_error
5 5 from pylons_app.config.routing import make_map
6 6 from pylons_app.lib.auth import set_available_permissions
7 from pylons_app.lib.utils import repo2db_mapper
7 8 from pylons_app.model import init_model
8 9 from sqlalchemy import engine_from_config
9 10 import logging
@@ -11,8 +12,6 b' import os'
11 12 import pylons_app.lib.app_globals as app_globals
12 13 import pylons_app.lib.helpers
13 14
14
15
16 15 log = logging.getLogger(__name__)
17 16
18 17 def load_environment(global_conf, app_conf):
@@ -39,7 +38,6 b' def load_environment(global_conf, app_co'
39 38 import pylons
40 39 pylons.cache._push_object(config['pylons.app_globals'].cache)
41 40
42
43 41 # Create the Mako TemplateLookup, with the default auto-escaping
44 42 config['pylons.app_globals'].mako_lookup = TemplateLookup(
45 43 directories=paths['templates'],
@@ -48,7 +46,7 b' def load_environment(global_conf, app_co'
48 46 input_encoding='utf-8', default_filters=['escape'],
49 47 imports=['from webhelpers.html import escape'])
50 48
51 #sets the c attribute access when don't existing attribute ar accessed
49 #sets the c attribute access when don't existing attribute are accessed
52 50 config['pylons.strict_tmpl_context'] = True
53 51
54 52 #MULTIPLE DB configs
@@ -62,7 +60,7 b' def load_environment(global_conf, app_co'
62 60 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
63 61
64 62 init_model(sa_engine_db1)
65
63 repo2db_mapper()
66 64 set_available_permissions(config)
67 65 # CONFIGURATION OPTIONS HERE (note: all config options will override
68 66 # any Pylons config options)
@@ -1,6 +1,29 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # admin controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 7, 2010
22 admin controller for pylons
23 @author: marcink
24 """
1 25 import logging
2 from pylons import request, response, session, tmpl_context as c, url, app_globals as g
3 from pylons.controllers.util import abort, redirect
26 from pylons import request, response, session, tmpl_context as c
4 27 from pylons_app.lib.base import BaseController, render
5 28 from pylons_app.model import meta
6 29 from pylons_app.model.db import UserLog
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # branches controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 21, 2010
22 branches controller for pylons
23 @author: marcink
24 """
1 25 from pylons import tmpl_context as c, app_globals as g
2 26 from pylons_app.lib.auth import LoginRequired
3 27 from pylons_app.lib.base import BaseController, render
@@ -1,11 +1,31 b''
1 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
2 from mercurial.node import short
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # changelog controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 21, 2010
22 changelog controller for pylons
23 @author: marcink
24 """
3 25 from pylons import request, session, tmpl_context as c
4 26 from pylons_app.lib.auth import LoginRequired
5 27 from pylons_app.lib.base import BaseController, render
6 from pylons_app.lib.filters import age as _age, person
7 28 from pylons_app.model.hg_model import _full_changelog_cached
8 from simplejson import dumps
9 29 from webhelpers.paginate import Page
10 30 import logging
11 31 log = logging.getLogger(__name__)
@@ -43,32 +63,33 b' class ChangelogController(BaseController'
43 63
44 64
45 65 def _graph(self, repo, size, p):
46 revcount = size
47 if not repo.revisions:return dumps([]), 0
48
49 max_rev = repo.revisions[-1]
50 offset = 1 if p == 1 else ((p - 1) * revcount)
51 rev_start = repo.revisions[(-1 * offset)]
52 c.bg_height = 120
53
54 revcount = min(max_rev, revcount)
55 rev_end = max(0, rev_start - revcount)
56 dag = graph_rev(repo.repo, rev_start, rev_end)
57
58 c.dag = tree = list(colored(dag))
59 canvasheight = (len(tree) + 1) * c.bg_height - 27
60 data = []
61 for (id, type, ctx, vtx, edges) in tree:
62 if type != CHANGESET:
63 continue
64 node = short(ctx.node())
65 age = _age(ctx.date())
66 desc = ctx.description()
67 user = person(ctx.user())
68 branch = ctx.branch()
69 branch = branch, repo.repo.branchtags().get(branch) == ctx.node()
70 data.append((node, vtx, edges, desc, user, age, branch, ctx.tags()))
71
72 c.jsdata = dumps(data)
73 c.canvasheight = canvasheight
66 pass
67 # revcount = size
68 # if not repo.revisions:return dumps([]), 0
69 #
70 # max_rev = repo.revisions[-1]
71 # offset = 1 if p == 1 else ((p - 1) * revcount)
72 # rev_start = repo.revisions[(-1 * offset)]
73 # c.bg_height = 120
74 #
75 # revcount = min(max_rev, revcount)
76 # rev_end = max(0, rev_start - revcount)
77 # dag = graph_rev(repo.repo, rev_start, rev_end)
78 #
79 # c.dag = tree = list(colored(dag))
80 # canvasheight = (len(tree) + 1) * c.bg_height - 27
81 # data = []
82 # for (id, type, ctx, vtx, edges) in tree:
83 # if type != CHANGESET:
84 # continue
85 # node = short(ctx.node())
86 # age = _age(ctx.date())
87 # desc = ctx.description()
88 # user = person(ctx.user())
89 # branch = ctx.branch()
90 # branch = branch, repo.repo.branchtags().get(branch) == ctx.node()
91 # data.append((node, vtx, edges, desc, user, age, branch, ctx.tags()))
92 #
93 # c.jsdata = dumps(data)
94 # c.canvasheight = canvasheight
74 95
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # changeset controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 25, 2010
22 changeset controller for pylons
23 @author: marcink
24 """
1 25 from pylons import tmpl_context as c
2 26 from pylons_app.lib.auth import LoginRequired
3 27 from pylons_app.lib.base import BaseController, render
@@ -1,5 +1,27 b''
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # feed controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 23, 2010
22 feed controller for pylons
23 @author: marcink
24 """
3 25 from pylons import tmpl_context as c, url, response
4 26 from pylons_app.lib.base import BaseController, render
5 27 from pylons_app.model.hg_model import _full_changelog_cached
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # files controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 21, 2010
22 files controller for pylons
23 @author: marcink
24 """
1 25 from mercurial import archival
2 26 from pylons import request, response, session, tmpl_context as c, url
3 27 from pylons_app.lib.auth import LoginRequired
@@ -1,20 +1,38 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # graph controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 21, 2010
22 graph controller for pylons
23 @author: marcink
24 """
1 25 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
2 26 from mercurial.node import short
3 from pylons import request, response, session, tmpl_context as c, url, config, \
4 app_globals as g
5 from pylons.controllers.util import abort, redirect
27 from pylons import request, tmpl_context as c
6 28 from pylons_app.lib.auth import LoginRequired
7 29 from pylons_app.lib.base import BaseController, render
8 30 from pylons_app.lib.filters import age as _age, person
9 from pylons_app.lib.utils import get_repo_slug
10 31 from pylons_app.model.hg_model import HgModel
11 32 from simplejson import dumps
12 33 from webhelpers.paginate import Page
13 34 import logging
14 35
15
16
17
18 36 log = logging.getLogger(__name__)
19 37
20 38 class GraphController(BaseController):
@@ -1,7 +1,29 b''
1 #!/usr/bin/python
2 # -*- coding: utf-8 -*-
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # hg controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on February 18, 2010
22 hg controller for pylons
23 @author: marcink
24 """
3 25 from operator import itemgetter
4 from pylons import tmpl_context as c, request, config
26 from pylons import tmpl_context as c, request
5 27 from pylons_app.lib.auth import LoginRequired
6 28 from pylons_app.lib.base import BaseController, render
7 29 from pylons_app.model.hg_model import HgModel
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # login controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 22, 2010
22 login controller for pylons
23 @author: marcink
24 """
1 25 import logging
2 26 from formencode import htmlfill
3 27 from pylons import request, response, session, tmpl_context as c, url
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # permissions controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 27, 2010
22 permissions controller for pylons
23 @author: marcink
24 """
1 25 import logging
2 26
3 27 from pylons import request, response, session, tmpl_context as c, url
@@ -1,3 +1,28 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # repos controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 7, 2010
22 admin controller for pylons
23 @author: marcink
24 """
25 import logging
1 26 from pylons import request, response, session, tmpl_context as c, url, \
2 27 app_globals as g
3 28 from pylons.controllers.util import abort, redirect
@@ -8,7 +33,6 b' from pylons_app.lib.base import BaseCont'
8 33 from pylons_app.lib.filters import clean_repo
9 34 from pylons_app.lib.utils import check_repo, invalidate_cache
10 35 from pylons_app.model.hg_model import HgModel
11 import logging
12 36 import os
13 37 import shutil
14 38 from operator import itemgetter
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # shortlog controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 18, 2010
22 shortlog controller for pylons
23 @author: marcink
24 """
1 25 from pylons import tmpl_context as c, request
2 26 from pylons_app.lib.auth import LoginRequired
3 27 from pylons_app.lib.base import BaseController, render
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # summary controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 18, 2010
22 summary controller for pylons
23 @author: marcink
24 """
1 25 from pylons import tmpl_context as c, request
2 26 from pylons_app.lib.auth import LoginRequired
3 27 from pylons_app.lib.base import BaseController, render
@@ -1,3 +1,27 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # tags controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 21, 2010
22 tags controller for pylons
23 @author: marcink
24 """
1 25 from pylons import tmpl_context as c
2 26 from pylons_app.lib.auth import LoginRequired
3 27 from pylons_app.lib.base import BaseController, render
@@ -1,3 +1,28 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # users controller for pylons
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 4, 2010
22 users controller for pylons
23 @author: marcink
24 """
25 import logging
1 26 from formencode import htmlfill
2 27 from pylons import request, session, tmpl_context as c, url
3 28 from pylons.controllers.util import abort, redirect
@@ -9,7 +34,6 b' from pylons_app.model.db import User, Us'
9 34 from pylons_app.model.forms import UserForm
10 35 from pylons_app.model.user_model import UserModel
11 36 import formencode
12 import logging
13 37
14 38 log = logging.getLogger(__name__)
15 39
@@ -1,3 +1,28 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # authentication and permission libraries
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20 """
21 Created on April 4, 2010
22
23 @author: marcink
24 """
25
1 26 from functools import wraps
2 27 from pylons import session, url, app_globals as g
3 28 from pylons.controllers.util import abort, redirect
@@ -1,4 +1,30 b''
1 '''BACKUP MANAGER'''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # mercurial repository backup manager
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on Feb 28, 2010
23 Mercurial repositories backup manager
24 @author: marcink
25 """
26
27
2 28 import logging
3 29 from mercurial import config
4 30 import tarfile
@@ -1,3 +1,29 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # database managment for hg app
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on April 10, 2010
23 database managment and creation for hg app
24 @author: marcink
25 """
26
1 27 from os.path import dirname as dn, join as jn
2 28 import os
3 29 import sys
@@ -1,3 +1,29 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # simple filters for hg apps html templates
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on April 12, 2010
23 simple filters for hg apps html templates
24 @author: marcink
25 """
26
1 27 from mercurial import util
2 28 from mercurial.templatefilters import age as _age, person as _person
3 29 from string import punctuation
@@ -1,3 +1,29 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # middleware to handle https correctly
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on May 23, 2010
23
24 @author: marcink
25 """
26
1 27 class HttpsFixup(object):
2 28 def __init__(self, app):
3 29 self.application = app
@@ -1,8 +1,23 b''
1 1 #!/usr/bin/env python
2 2 # encoding: utf-8
3 #
4 # Copyright (c) 2010 marcink. All rights reserved.
5 #
3 # middleware to handle mercurial api calls
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
6 21 """
7 22 Created on 2010-04-28
8 23
@@ -1,3 +1,29 b''
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Utilities for hg app
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on April 18, 2010
23 Utilities for hg app
24 @author: marcink
25 """
26
1 27 import os
2 28 import logging
3 29 from mercurial import ui, config, hg
@@ -131,4 +157,4 b' def repo2db_mapper():'
131 157 scann all dirs for .hgdbid
132 158 if some dir doesn't have one generate one.
133 159 """
134 pass No newline at end of file
160 pass
@@ -1,13 +1,28 b''
1 1 #!/usr/bin/env python
2 2 # encoding: utf-8
3 #
4 # Copyright (c) 2010 marcink. All rights reserved.
5 #
6 '''
7 Created on Apr 9, 2010
3 # Model for hg app
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
8 20
21 """
22 Created on April 9, 2010
23 Model for hg app
9 24 @author: marcink
10 '''
25 """
11 26
12 27 from beaker.cache import cache_region
13 28 from mercurial import ui
@@ -1,15 +1,31 b''
1 1 #!/usr/bin/env python
2 2 # encoding: utf-8
3 #
4 # Copyright (c) 2010 marcink. All rights reserved.
5 #
3 # Model for users
4 # Copyright (C) 2009-2010 Marcin Kuzminski <marcin@python-works.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; version 2
9 # of the License or (at your opinion) any later version of the license.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 # MA 02110-1301, USA.
20
21 """
22 Created on April 9, 2010
23 Model for users
24 @author: marcink
25 """
26
6 27 from pylons_app.model.db import User
7 28 from pylons_app.model.meta import Session
8 '''
9 Created on Apr 9, 2010
10
11 @author: marcink
12 '''
13 29
14 30 class UserModel(object):
15 31
@@ -16,6 +16,6 b''
16 16 <%def name="main()">
17 17 <div>
18 18 <h2>${_('Permissions')}</h2>
19 todo :)
19
20 20 </div>
21 21 </%def>
General Comments 0
You need to be logged in to leave comments. Login now