fjorba / dircloud Goto Github PK
View Code? Open in Web Editor NEWView and navigate through the contents of your disc using a word-cloud interface
View and navigate through the contents of your disc using a word-cloud interface
Two test files have been generated on my system with
$ du /boot > test1
$ du /boot/ > test2
I created a couple of tests, checking that read_du_file_maybe()
generates the same dictionary for both. You can find the test code and the generated files on my fork (just run py.test
on the dircloud
root directory).
dircloud
runs ok with the first file; visiting `http://localhost:2010:/boot/' gets:
$ ./dircloud.py tests/fixtures/du.boot
Bottle server starting up (using WSGIRefServer())...
Listening on http://localhost:2010/
Hit Ctrl-C to quit.
dirpath = [boot/]
localhost - - [20/Feb/2012 17:04:24] "GET /boot/ HTTP/1.1" 200 3468
While the other file raises an exception for the same request:
$ ./dircloud.py tests/fixtures/du.boot_with_final_slash
Bottle server starting up (using WSGIRefServer())...
Listening on http://localhost:2010/
Hit Ctrl-C to quit.
dirpath = [boot/]
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 737, in _handle
return route.call(**args)
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1456, in wrapper
rv = callback(*a, **ka)
File "./dircloud.py", line 106, in dircloud
search='', body=cloud, footer=footer)
File "./dircloud.py", line 312, in make_html_page
filesize = du[dirpath.rstrip(read_from_disk)]
KeyError: 'boot/'
localhost - - [20/Feb/2012 17:04:34] "GET /boot/ HTTP/1.1" 500 1416
I've added a print du
just before the line raising the exception. I don't fully understand why, but that's what it shows:
{'boot/grub/locale/': 16384, 'boot//': 138924032, 'boot/grub/': 4460544}
Got this exception on every request.
localhost - - [20/Feb/2012 14:02:42] "GET / HTTP/1.1" 200 8495
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 737, in _handle
return route.call(**args)
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1456, in wrapper
rv = callback(*a, **ka)
File "./dircloud.py", line 102, in dircloud
return static_file(filename, root=path, guessmime=guessmime)
TypeError: static_file() got an unexpected keyword argument 'guessmime'
Bottle's stable version (0.10) does not have a guessmime
argument for static_file()
.
A "KeyError" exception is raised on every page. For http://localhost:2010/boot/
:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 737, in _handle
return route.call(**args)
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1456, in wrapper
rv = callback(*a, **ka)
File "./dircloud.py", line 106, in dircloud
search='', body=cloud, footer=footer)
File "./dircloud.py", line 312, in make_html_page
filesize = du[dirpath.rstrip(read_from_disk)]
KeyError: 'boot/'
Looks like the route paremeter is /boot/
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.