Code Monkey home page Code Monkey logo

dircloud's People

Contributors

fjorba avatar

Stargazers

 avatar  avatar

Forkers

funollet

dircloud's Issues

Diferent behaviour if du arguments has a final slash

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}

TypeError: static_file() got an unexpected keyword argument 'guessmime'

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().

KeyError on every page

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/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.