wepub

Check-in [d66eb4ae50]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Make dir/file lists ordered
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:d66eb4ae504e7ca0e5c4d2968895d15a75caa9e6a3ee63227cf42c9f61d61744
User & Date: ajv-899-334-8894@vsta.org 2016-11-20 15:20:55
Context
2016-11-21
14:03
Recently read list. Fix a dequoting API call. check-in: cfb00a34a5 user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-11-20
15:20
Make dir/file lists ordered check-in: d66eb4ae50 user: ajv-899-334-8894@vsta.org tags: master, trunk
01:06
Add next/prev chapter buttons check-in: 3a8bcbbe3f user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to get.py.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
#
# Structure of paths in the server:
#  /
#	Main UI.  Top part is playlist, bottom is file/dir browser
#  /media/<prefix>/...
#	For each prefix of files, its contents is served by
#	way of its path under here.
import pdb
import os, stat, urllib
import epub

# The GET part of our handling
class GET_mixin(object):

    # Configure our WPlayer GET treatment
................................................................................
            return False,None
        label = parts[-1] if parts else section
        buf = self.build_header("<h2>%s</h2><p>\n" % (label,))

        # List book files (if any)
        if books:
            buf += "<p><h3>Books</h3>\n<ul>\n"
            for f in books:
                buf += ' <li><a href="%s">%s</a></li>\n' % \
                    (os.path.join(self.path, f), f[:-5])
            buf += "</ul>\n"

        # List sub-folders (if any)
        if dirs:
            buf += "<p><h3>Sub-Folders</h3>\n<ul>\n"
            for d in dirs:
                buf += ' <li><a href="%s">%s</a></li>\n' % \
                    (os.path.join(self.path, d), d)
            buf += "</ul>\n"

        buf = self.build_tailer(buf)
        return True,self.send_result(buf, "text/html")








<







 







|







|







4
5
6
7
8
9
10

11
12
13
14
15
16
17
...
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
#
# Structure of paths in the server:
#  /
#	Main UI.  Top part is playlist, bottom is file/dir browser
#  /media/<prefix>/...
#	For each prefix of files, its contents is served by
#	way of its path under here.

import os, stat, urllib
import epub

# The GET part of our handling
class GET_mixin(object):

    # Configure our WPlayer GET treatment
................................................................................
            return False,None
        label = parts[-1] if parts else section
        buf = self.build_header("<h2>%s</h2><p>\n" % (label,))

        # List book files (if any)
        if books:
            buf += "<p><h3>Books</h3>\n<ul>\n"
            for f in sorted(books):
                buf += ' <li><a href="%s">%s</a></li>\n' % \
                    (os.path.join(self.path, f), f[:-5])
            buf += "</ul>\n"

        # List sub-folders (if any)
        if dirs:
            buf += "<p><h3>Sub-Folders</h3>\n<ul>\n"
            for d in sorted(dirs):
                buf += ' <li><a href="%s">%s</a></li>\n' % \
                    (os.path.join(self.path, d), d)
            buf += "</ul>\n"

        buf = self.build_tailer(buf)
        return True,self.send_result(buf, "text/html")