Ticket #2923 (closed task: fixed)

Opened 7 years ago

Last modified 7 years ago

makeIndex.py needs to be updated and optimized

Reported by: lauren Owned by: sj
Priority: blocker Milestone: Not Triaged
Component: library Version:
Keywords: Cc: lauren, mako
Action Needed: Verified: no
Deployments affected: Blocked By:
Blocking:

Description

If we don't have a webserver on the laptop for T3 (see #1267), the makeIndex.py script needs to be updated to reflect the current library.info fields and then optimized for actual use.

Current library.info file: http://wiki.laptop.org/go/Library.info Current makeIndex.py script: http://dev.laptop.org/git?p=projects/content-bundler;a=tree;h=1ed3619d2253c84d877683f96d1b26d62f484723;hb=1ed3619d2253c84d877683f96d1b26d62f484723

Change History

follow-up: ↓ 2   Changed 7 years ago by marco

What's up with this and why is it not assigned to the author of makeIndex.py?

in reply to: ↑ 1   Changed 7 years ago by lauren

  • owner changed from dcbw to simon

Replying to marco:

What's up with this and why is it not assigned to the author of makeIndex.py?

Simon Schamijer said he'd take care of it, I think.

  Changed 7 years ago by marco

  • owner changed from simon to Simon

We need to fix Simon name in trac ;)

  Changed 7 years ago by Simon

  • owner changed from Simon to sj

Sj, are we clear now how this should happen? Can we clarify what the script needs to do exactly. Where shall the config.js file be generated?

Thanks

  Changed 7 years ago by danw

  • priority changed from normal to blocker

content bundles won't be installable until this is fixed

  Changed 7 years ago by sj

  • owner changed from sj to Simon

config.js file should be generated in the scripts/ directory; the location is specified in the "makeConfig(...)" line towards the end.

  Changed 7 years ago by marco

  • owner changed from Simon to sj
  • component changed from sugar to library

configPath = "/Users/lauren/Desktop/Library/newscripts/" !?!?!?!?

Get us a working version of makeIndex.py and we will integrate it. Until then this is not a sugar bug.

  Changed 7 years ago by sj

  • owner changed from sj to Simon

see the makeIndex.py and new html in this bundle: http://dev.laptop.org/pub/content/Library-latest.tar.gz

This gets rid of the frames and related problems of previous iterations, and uses a template system that will remain useful when we move towards a more dynamic library-view that relies on a local webserver.

makeIndex.py should be run each time a new bundle is installed. It looks in every subdirectory of Library/ for a library/library.info file (indicating it's a bundle) and an index.html file (indicating it is browsable). It generates a sidebar from the browsable bundles, and creates a bundle_index.html in each of those directories wrapping the existing index in the sidebar.

This is fairly robust to bad bundles; if the script somehow dies before processing one of the bundles it simply doesn't update the index pages. The robustness could be improved in the future with more clever defaults and handling for css class clashes.

  Changed 7 years ago by erikos

  • cc mako added
  • owner changed from Simon to sj

1) Those should change: library_path = '/var/www/content/proto/tmpl-Library/Library' #TODO TURN ME OFF base_url = 'http://dev.laptop.org/pub/content/proto/tmpl-Library/Library' # TODO TURN ME OFF TOO

to this to work on the xo:

library_path = env.get_user_library_path() base_url = library_path

2) all the bundles i downloaded (http://dev.laptop.org/pub/content/newlibrary/icdl.xol, http://dev.laptop.org/~arael/bundles/bible-en.xol,...) did not work

a) the category does not exist in the categories.info file, so what do you want to do in this case, make a new category? Or add to misc?

[erikos@localhost Library]$ python makeIndex.py
Traceback (most recent call last):
  File "makeIndex.py", line 83, in <module>
    category_data[new_bundle['category']]['bundles'].append(new_bundle) 
KeyError: u'"religion"'

b) a lot of bundles have their values with "" like name = "bible-en" c) the bundle name (directory name) for example bundle-en is not the same than the name in library.info bible which breaks in get_cat_for_bundle(bundle)

  Changed 7 years ago by erikos

danw wrote the part that makeindex will be called in sugar when a new bundle is installed. Once the makeindex works the installation will work.

  Changed 7 years ago by sj

see #3970. this is now fixed; new bundles go in the 'other' category if they have unusual categories. some bundles need to fix their library.info files; but a broken bundle won't break the interface.

  Changed 7 years ago by sj

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.