Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Fixed sub directory navigation in weltmeister
Browse files Browse the repository at this point in the history
  • Loading branch information
amadeus committed Nov 3, 2012
1 parent 4593b80 commit 2009d37
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions server.py
Expand Up @@ -128,13 +128,16 @@ def save(self):

def browse(self):
# Get the directory to scan
dir = self.query_params['dir'][0] if 'dir' in self.query_params else '.'
dir = dir.replace('..', '')
if dir[-1] != '/':
dir += '/'
dir = ''
if 'dir' in self.query_params:
dir = self.query_params['dir'][0].replace('..', '')
if dir[-1] != '/':
dir += '/'

# Get the dir and files
dirs = [d for d in os.listdir(os.path.join(BASE_DIR, dir)) if '.' not in d]
dirs = [os.path.join(dir, d) for d in os.listdir(os.path.join(BASE_DIR, dir))
if os.path.isdir(os.path.join(dir, d))]

files = glob.glob(dir + '*.*')

# Filter on file types
Expand Down

0 comments on commit 2009d37

Please sign in to comment.