more stuff
This commit is contained in:
parent
696f2775ac
commit
496e5b402f
2 changed files with 1 additions and 28 deletions
28
mystuff.py
28
mystuff.py
|
@ -6,33 +6,7 @@ from os.path import isdir
|
|||
conf = {}
|
||||
|
||||
#conf['root'] = '/srv/git/repo'
|
||||
conf['public'] = '/home/amdavidson/dev/myStuff/public'
|
||||
conf['private'] = '/home/amdavidson/dev/myStuff/private'
|
||||
|
||||
@route('/public')
|
||||
@route('/public/')
|
||||
@route('/public/<name:path>')
|
||||
def public(name=''):
|
||||
tree = []
|
||||
data = []
|
||||
|
||||
path = os.path.join(conf['public'], name.lstrip('../'))
|
||||
|
||||
if os.path.exists(path):
|
||||
if isdir(path):
|
||||
for f in os.listdir(path):
|
||||
if not f.startswith('.') and not f.startswith('_'):
|
||||
tree.append('<a href="/public/'+os.path.join(name,f)+'">'+f+'</a>')
|
||||
else:
|
||||
return static_file(name, root=conf['public'])
|
||||
|
||||
else:
|
||||
|
||||
return 'File does not exist.'
|
||||
|
||||
|
||||
return template('templates/yield', content="<br/>".join(tree)+'<br/>'+ \
|
||||
'<br/>'.join(data), title="Files in "+name)
|
||||
conf['private'] = '/srv/git/documents'
|
||||
|
||||
|
||||
@route('/private')
|
||||
|
|
1
public
1
public
|
@ -1 +0,0 @@
|
|||
Subproject commit aab29bb1a3ac7d75b38ad70d4ea4566767893a26
|
Loading…
Reference in a new issue