-
Notifications
You must be signed in to change notification settings - Fork 1
/
notes.txt
48 lines (41 loc) · 2.28 KB
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Twisted docs: http://twistedmatrix.com/trac/
Concept: consume a directory (or directories?) and return JSON at a few URL patterns
root = titles I know about
/name = issues of a given title
/name/issue id = json dump of {page & image urls}
/name/issue id/page = image url
TODO
document functions and clean up pathing logic
trap case where you restart server and temp directory has gone away but you're looking at issue file list again
Issues
file name formatting is incredibly inconsistent
ignore all the shit in parentheses
if all else fails, lose ALL of the alpha characters and just get the numbers, fall back to parent directory name
issue numbering is something of a mess
once you figure out file name concept, strip out leading 0s to prevent 010 being in front of 02
can I at least trust directory names to be meaningful and correct?
be nice to process folders, files and contents via a generator, so there isn't a huge start up issue
bonus points: watch directory for changes, update
serve files
https://github.com/yosinski/simple-twisted-image-server/blob/master/server.py
http://stackoverflow.com/questions/1538617/http-download-very-big-file
http://codereview.stackexchange.com/questions/2315/file-serving-twisted-resource
http://stackoverflow.com/questions/4110579/twisted-web-how-do-i-properly-images-from-an-images-directory
RAR Files
rarfile docs: http://rarfile.berlios.de/doc/
http://stackoverflow.com/questions/1185959/read-content-of-rar-file-into-memory-in-python
having trouble figuring out how to extract the files locally
Configuration file
port number
root directory
Server
big Twisted tutorial at http://krondo.com/blog/?page_id=1327
learn how to build a proper server and break out code
threads - http://stackoverflow.com/questions/5904734/twisted-deferred-vs-blocking-in-web-services
add ability to shut the thing down
also make sure to close connections properly
need to read http://blackjml.livejournal.com/23029.html
some more info at http://zenmachine.wordpress.com/web-services-and-twisted/
would be good to be caching results after startup
Misc
Why does server find hundreds fewer files on Mac looking at the same directory?