X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a73b3d8f83229ad3ebf10115d38992ca68577b78..662a8a111721df714e9c95f94db91d2d03d7b19d:/apps/filebrowser/views.py?ds=inline diff --git a/apps/filebrowser/views.py b/apps/filebrowser/views.py index 3dcba4a3..30869a4d 100644 --- a/apps/filebrowser/views.py +++ b/apps/filebrowser/views.py @@ -1,7 +1,7 @@ # coding: utf-8 # general imports -import os, re +import os, re, locale from time import gmtime, strftime # django imports @@ -17,6 +17,8 @@ from django.core.urlresolvers import reverse from django.core.exceptions import ImproperlyConfigured from django.dispatch import Signal +from django.utils.encoding import smart_unicode, smart_str + # filebrowser imports from filebrowser.fb_settings import * from filebrowser.functions import _url_to_path, _path_to_url, _get_path, _get_file, _get_version_path, _get_breadcrumbs, _get_filterdate, _get_settings_var, _handle_file_upload, _get_file_type, _url_join, _convert_filename @@ -61,8 +63,9 @@ def browse(request): dir_list = os.listdir(abs_path) files = [] + # print "LISTING FILES: ", dir_list for file in dir_list: - + # print repr(file) # EXCLUDE FILES MATCHING VERSIONS_PREFIX OR ANY OF THE EXCLUDE PATTERNS filtered = file.startswith('.') for re_prefix in filter_re: @@ -73,7 +76,7 @@ def browse(request): results_var['results_total'] += 1 # CREATE FILEOBJECT - fileobject = FileObject(os.path.join(DIRECTORY, path, file)) + fileobject = FileObject(os.path.join(smart_str(DIRECTORY), smart_str(path), smart_str(file))) # FILTER / SEARCH append = False