2
# Copyright (C) 2006 Robey Pointer <robey@lag.net>
4
# This program is free software; you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation; either version 2 of the License, or
7
# (at your option) any later version.
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22
from turbogears import controllers
23
from cherrypy import HTTPRedirect, NotFound
26
from okulo.controllers.page_ui import PageUI
27
from okulo.controllers.login_ui import LoginUI, LogoutUI
28
from okulo.controllers.history_ui import HistoryUI
29
from okulo.controllers.edit_ui import EditUI
30
from okulo.controllers.contents_ui import ContentsUI
31
from okulo.controllers.source_ui import SourceUI
32
from okulo.controllers.search_ui import SearchUI
33
from okulo.controllers.add_ui import AddUI
34
from okulo.controllers.signup_ui import SignupUI
35
from okulo.controllers.atom_ui import AtomUI
36
from okulo.controllers.userhome_ui import UserHomeUI
37
from okulo.controllers.delete_ui import DeleteUI
39
from loggerhead.controllers.changelog_ui import ChangeLogUI
40
from loggerhead.controllers.atom_ui import AtomUI
43
log = logging.getLogger("loggerhead.controllers")
45
class Root (controllers.RootController):
46
changes = ChangeLogUI()
49
@turbogears.expose(template="loggerhead.templates.welcome")
52
log.debug("Happy TurboGears Controller Responding For Duty")
53
return dict(now=time.ctime())
56
if args['cmd'][0] == 'changelog':
58
otherrevid = get("otherrevid")
59
pathrevid = get("pathrevid")
62
self.write(self.changelog(revno, None, path, pathrevid, otherrevid))
64
def changelog(self, revid, search=None, path=None,
65
pathrevid=None, otherrevid=None ):
67
return cmd_changelog.changelog(self, revid, search, path,
68
pathrevid, otherrevid )
72
revid, history, pathrevid, otherrevid =
73
hgweb.compute_history(revid, path, pathrevid, otherrevid )
76
class Root (controllers.Root):
82
contents = ContentsUI()
91
def index(self, *args):
92
raise HTTPRedirect(turbogears.url('/page/start'))
95
def default(self, *args):
96
if args[0].startswith('~'):
97
home = UserHomeUI(args[0][1:])
100
return home.default(*args[1:])