##// 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 access to copy the source code from the same place counts as
168 access to copy the source code from the same place counts as
169 distribution of the source code, even though third parties are not
169 distribution of the source code, even though third parties are not
170 compelled to copy the source along with the object code.
170 compelled to copy the source along with the object code.
171
171
172 4. You may not copy, modify, sublicense, or distribute the Program
172 4. You may not copy, modify, sublicense, or distribute the Program
173 except as expressly provided under this License. Any attempt
173 except as expressly provided under this License. Any attempt
174 otherwise to copy, modify, sublicense or distribute the Program is
174 otherwise to copy, modify, sublicense or distribute the Program is
@@ -278,7 +278,7 b' PROGRAMS), EVEN IF SUCH HOLDER OR OTHER '
278 POSSIBILITY OF SUCH DAMAGES.
278 POSSIBILITY OF SUCH DAMAGES.
279
279
280 END OF TERMS AND CONDITIONS
280 END OF TERMS AND CONDITIONS
281
281
282 How to Apply These Terms to Your New Programs
282 How to Apply These Terms to Your New Programs
283
283
284 If you develop a new program, and you want it to be of the greatest
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 Hg app, a web based mercurial repository managment based on pylons
23 Hg app, a web based mercurial repository managment based on pylons
24 @author: marcink
3 """
25 """
4
26
5 VERSION = (0, 7, 6, 'beta')
27 VERSION = (0, 7, 6, 'beta')
@@ -4,6 +4,7 b' from pylons.configuration import PylonsC'
4 from pylons.error import handle_mako_error
4 from pylons.error import handle_mako_error
5 from pylons_app.config.routing import make_map
5 from pylons_app.config.routing import make_map
6 from pylons_app.lib.auth import set_available_permissions
6 from pylons_app.lib.auth import set_available_permissions
7 from pylons_app.lib.utils import repo2db_mapper
7 from pylons_app.model import init_model
8 from pylons_app.model import init_model
8 from sqlalchemy import engine_from_config
9 from sqlalchemy import engine_from_config
9 import logging
10 import logging
@@ -11,8 +12,6 b' import os'
11 import pylons_app.lib.app_globals as app_globals
12 import pylons_app.lib.app_globals as app_globals
12 import pylons_app.lib.helpers
13 import pylons_app.lib.helpers
13
14
14
15
16 log = logging.getLogger(__name__)
15 log = logging.getLogger(__name__)
17
16
18 def load_environment(global_conf, app_conf):
17 def load_environment(global_conf, app_conf):
@@ -39,7 +38,6 b' def load_environment(global_conf, app_co'
39 import pylons
38 import pylons
40 pylons.cache._push_object(config['pylons.app_globals'].cache)
39 pylons.cache._push_object(config['pylons.app_globals'].cache)
41
40
42
43 # Create the Mako TemplateLookup, with the default auto-escaping
41 # Create the Mako TemplateLookup, with the default auto-escaping
44 config['pylons.app_globals'].mako_lookup = TemplateLookup(
42 config['pylons.app_globals'].mako_lookup = TemplateLookup(
45 directories=paths['templates'],
43 directories=paths['templates'],
@@ -48,7 +46,7 b' def load_environment(global_conf, app_co'
48 input_encoding='utf-8', default_filters=['escape'],
46 input_encoding='utf-8', default_filters=['escape'],
49 imports=['from webhelpers.html import escape'])
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 config['pylons.strict_tmpl_context'] = True
50 config['pylons.strict_tmpl_context'] = True
53
51
54 #MULTIPLE DB configs
52 #MULTIPLE DB configs
@@ -62,7 +60,7 b' def load_environment(global_conf, app_co'
62 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
60 sa_engine_db1 = engine_from_config(config, 'sqlalchemy.db1.')
63
61
64 init_model(sa_engine_db1)
62 init_model(sa_engine_db1)
65
63 repo2db_mapper()
66 set_available_permissions(config)
64 set_available_permissions(config)
67 # CONFIGURATION OPTIONS HERE (note: all config options will override
65 # CONFIGURATION OPTIONS HERE (note: all config options will override
68 # any Pylons config options)
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 import logging
25 import logging
2 from pylons import request, response, session, tmpl_context as c, url, app_globals as g
26 from pylons import request, response, session, tmpl_context as c
3 from pylons.controllers.util import abort, redirect
4 from pylons_app.lib.base import BaseController, render
27 from pylons_app.lib.base import BaseController, render
5 from pylons_app.model import meta
28 from pylons_app.model import meta
6 from pylons_app.model.db import UserLog
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 from pylons import tmpl_context as c, app_globals as g
25 from pylons import tmpl_context as c, app_globals as g
2 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
3 from pylons_app.lib.base import BaseController, render
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
1 #!/usr/bin/env python
2 from mercurial.node import short
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 from pylons import request, session, tmpl_context as c
25 from pylons import request, session, tmpl_context as c
4 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
5 from pylons_app.lib.base import BaseController, render
27 from pylons_app.lib.base import BaseController, render
6 from pylons_app.lib.filters import age as _age, person
7 from pylons_app.model.hg_model import _full_changelog_cached
28 from pylons_app.model.hg_model import _full_changelog_cached
8 from simplejson import dumps
9 from webhelpers.paginate import Page
29 from webhelpers.paginate import Page
10 import logging
30 import logging
11 log = logging.getLogger(__name__)
31 log = logging.getLogger(__name__)
@@ -43,32 +63,33 b' class ChangelogController(BaseController'
43
63
44
64
45 def _graph(self, repo, size, p):
65 def _graph(self, repo, size, p):
46 revcount = size
66 pass
47 if not repo.revisions:return dumps([]), 0
67 # revcount = size
48
68 # if not repo.revisions:return dumps([]), 0
49 max_rev = repo.revisions[-1]
69 #
50 offset = 1 if p == 1 else ((p - 1) * revcount)
70 # max_rev = repo.revisions[-1]
51 rev_start = repo.revisions[(-1 * offset)]
71 # offset = 1 if p == 1 else ((p - 1) * revcount)
52 c.bg_height = 120
72 # rev_start = repo.revisions[(-1 * offset)]
53
73 # c.bg_height = 120
54 revcount = min(max_rev, revcount)
74 #
55 rev_end = max(0, rev_start - revcount)
75 # revcount = min(max_rev, revcount)
56 dag = graph_rev(repo.repo, rev_start, rev_end)
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
57
95
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
74
@@ -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 from pylons import tmpl_context as c
25 from pylons import tmpl_context as c
2 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
3 from pylons_app.lib.base import BaseController, render
27 from pylons_app.lib.base import BaseController, render
@@ -1,5 +1,27 b''
1 #!/usr/bin/python
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
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 from pylons import tmpl_context as c, url, response
25 from pylons import tmpl_context as c, url, response
4 from pylons_app.lib.base import BaseController, render
26 from pylons_app.lib.base import BaseController, render
5 from pylons_app.model.hg_model import _full_changelog_cached
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 from mercurial import archival
25 from mercurial import archival
2 from pylons import request, response, session, tmpl_context as c, url
26 from pylons import request, response, session, tmpl_context as c, url
3 from pylons_app.lib.auth import LoginRequired
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 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
25 from mercurial.graphmod import revisions as graph_rev, colored, CHANGESET
2 from mercurial.node import short
26 from mercurial.node import short
3 from pylons import request, response, session, tmpl_context as c, url, config, \
27 from pylons import request, tmpl_context as c
4 app_globals as g
5 from pylons.controllers.util import abort, redirect
6 from pylons_app.lib.auth import LoginRequired
28 from pylons_app.lib.auth import LoginRequired
7 from pylons_app.lib.base import BaseController, render
29 from pylons_app.lib.base import BaseController, render
8 from pylons_app.lib.filters import age as _age, person
30 from pylons_app.lib.filters import age as _age, person
9 from pylons_app.lib.utils import get_repo_slug
10 from pylons_app.model.hg_model import HgModel
31 from pylons_app.model.hg_model import HgModel
11 from simplejson import dumps
32 from simplejson import dumps
12 from webhelpers.paginate import Page
33 from webhelpers.paginate import Page
13 import logging
34 import logging
14
35
15
16
17
18 log = logging.getLogger(__name__)
36 log = logging.getLogger(__name__)
19
37
20 class GraphController(BaseController):
38 class GraphController(BaseController):
@@ -1,7 +1,29 b''
1 #!/usr/bin/python
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
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 from operator import itemgetter
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 from pylons_app.lib.auth import LoginRequired
27 from pylons_app.lib.auth import LoginRequired
6 from pylons_app.lib.base import BaseController, render
28 from pylons_app.lib.base import BaseController, render
7 from pylons_app.model.hg_model import HgModel
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 import logging
25 import logging
2 from formencode import htmlfill
26 from formencode import htmlfill
3 from pylons import request, response, session, tmpl_context as c, url
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 import logging
25 import logging
2
26
3 from pylons import request, response, session, tmpl_context as c, url
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 from pylons import request, response, session, tmpl_context as c, url, \
26 from pylons import request, response, session, tmpl_context as c, url, \
2 app_globals as g
27 app_globals as g
3 from pylons.controllers.util import abort, redirect
28 from pylons.controllers.util import abort, redirect
@@ -8,7 +33,6 b' from pylons_app.lib.base import BaseCont'
8 from pylons_app.lib.filters import clean_repo
33 from pylons_app.lib.filters import clean_repo
9 from pylons_app.lib.utils import check_repo, invalidate_cache
34 from pylons_app.lib.utils import check_repo, invalidate_cache
10 from pylons_app.model.hg_model import HgModel
35 from pylons_app.model.hg_model import HgModel
11 import logging
12 import os
36 import os
13 import shutil
37 import shutil
14 from operator import itemgetter
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 from pylons import tmpl_context as c, request
25 from pylons import tmpl_context as c, request
2 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
3 from pylons_app.lib.base import BaseController, render
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 from pylons import tmpl_context as c, request
25 from pylons import tmpl_context as c, request
2 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
3 from pylons_app.lib.base import BaseController, render
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 from pylons import tmpl_context as c
25 from pylons import tmpl_context as c
2 from pylons_app.lib.auth import LoginRequired
26 from pylons_app.lib.auth import LoginRequired
3 from pylons_app.lib.base import BaseController, render
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 from formencode import htmlfill
26 from formencode import htmlfill
2 from pylons import request, session, tmpl_context as c, url
27 from pylons import request, session, tmpl_context as c, url
3 from pylons.controllers.util import abort, redirect
28 from pylons.controllers.util import abort, redirect
@@ -9,7 +34,6 b' from pylons_app.model.db import User, Us'
9 from pylons_app.model.forms import UserForm
34 from pylons_app.model.forms import UserForm
10 from pylons_app.model.user_model import UserModel
35 from pylons_app.model.user_model import UserModel
11 import formencode
36 import formencode
12 import logging
13
37
14 log = logging.getLogger(__name__)
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 from functools import wraps
26 from functools import wraps
2 from pylons import session, url, app_globals as g
27 from pylons import session, url, app_globals as g
3 from pylons.controllers.util import abort, redirect
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 import logging
28 import logging
3 from mercurial import config
29 from mercurial import config
4 import tarfile
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 from os.path import dirname as dn, join as jn
27 from os.path import dirname as dn, join as jn
2 import os
28 import os
3 import sys
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 from mercurial import util
27 from mercurial import util
2 from mercurial.templatefilters import age as _age, person as _person
28 from mercurial.templatefilters import age as _age, person as _person
3 from string import punctuation
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 class HttpsFixup(object):
27 class HttpsFixup(object):
2 def __init__(self, app):
28 def __init__(self, app):
3 self.application = app
29 self.application = app
@@ -1,8 +1,23 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # encoding: utf-8
2 # encoding: utf-8
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.
3 #
10 #
4 # Copyright (c) 2010 marcink. All rights reserved.
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.
5 #
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 Created on 2010-04-28
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 import os
27 import os
2 import logging
28 import logging
3 from mercurial import ui, config, hg
29 from mercurial import ui, config, hg
@@ -131,4 +157,4 b' def repo2db_mapper():'
131 scann all dirs for .hgdbid
157 scann all dirs for .hgdbid
132 if some dir doesn't have one generate one.
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 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # encoding: utf-8
2 # encoding: utf-8
3 #
3 # Model for hg app
4 # Copyright (c) 2010 marcink. All rights reserved.
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.
5 #
10 #
6 '''
11 # This program is distributed in the hope that it will be useful,
7 Created on Apr 9, 2010
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 @author: marcink
24 @author: marcink
10 '''
25 """
11
26
12 from beaker.cache import cache_region
27 from beaker.cache import cache_region
13 from mercurial import ui
28 from mercurial import ui
@@ -1,15 +1,31 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # encoding: utf-8
2 # encoding: utf-8
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.
3 #
10 #
4 # Copyright (c) 2010 marcink. All rights reserved.
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.
5 #
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 from pylons_app.model.db import User
27 from pylons_app.model.db import User
7 from pylons_app.model.meta import Session
28 from pylons_app.model.meta import Session
8 '''
9 Created on Apr 9, 2010
10
11 @author: marcink
12 '''
13
29
14 class UserModel(object):
30 class UserModel(object):
15
31
@@ -16,6 +16,6 b''
16 <%def name="main()">
16 <%def name="main()">
17 <div>
17 <div>
18 <h2>${_('Permissions')}</h2>
18 <h2>${_('Permissions')}</h2>
19 todo :)
19
20 </div>
20 </div>
21 </%def>
21 </%def>
General Comments 0
You need to be logged in to leave comments. Login now