comparison pylons_app/controllers/hg.py @ 12:5f30a6d558dc

Added pylons manage script fix the configs for zip archives some other minot changes.
author Marcin Kuzminski
date Sat, 20 Feb 2010 17:51:51 +0100
parents 525ed90e4577
children bbaab7501c1a
comparison
equal deleted inserted replaced
11:92b070bb061d 12:5f30a6d558dc
18 18
19 def view(self, *args, **kwargs): 19 def view(self, *args, **kwargs):
20 return g.hgapp(request.environ, self.start_response) 20 return g.hgapp(request.environ, self.start_response)
21 21
22 def add_repo(self, new_repo): 22 def add_repo(self, new_repo):
23 tmpl = ''' 23 tmpl = u'''
24 <html> 24 <html>
25 <body> 25 <body>
26 %(msg)s%(new_repo)s!<br \> 26 %(msg)s%(new_repo)s!<br \>
27 <a href="/">repos</a> 27 <a href="/">repos</a>
28 </body> 28 </body>
41 return [tmpl % ({'new_repo':' Exception when adding: ' + new_repo, 'msg':str(e)})] 41 return [tmpl % ({'new_repo':' Exception when adding: ' + new_repo, 'msg':str(e)})]
42 42
43 return [tmpl % ({'new_repo':new_repo, 'msg':'added repo: '})] 43 return [tmpl % ({'new_repo':new_repo, 'msg':'added repo: '})]
44 44
45 def _check_repo(self, repo_name): 45 def _check_repo(self, repo_name):
46 p = os.path.dirname(__file__) 46 p = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
47 config_path = os.path.join(p, '../..', 'hgwebdir.config') 47 config_path = os.path.join(p, 'hgwebdir.config')
48 48
49 cp = ConfigParser() 49 cp = ConfigParser()
50 50
51 cp.read(config_path) 51 cp.read(config_path)
52 repos_path = cp.get('paths', '/').replace("**", '') 52 repos_path = cp.get('paths', '/').replace("**", '')