0

I've been trying to figure out how to use the google closure library for d-pad navigation for my web app. I cannot for the life of me get closure to work. I'm following google's guide here https://developers.google.com/tv/web/lib/closure/gettingstarted

The guide asks to checkout from their SVN repo, but I'm just using the downloaded zip of the library from github. The guide asks to perform the following command

gtv-ui-lib/closure-library/closure/bin/build/depswriter.py \
  --root_with_prefix="gtv-ui-lib/source ../../../../gtv-ui-lib/source" \
  --output_file=tv-deps.js

to create a deps.js file. Can somebody explain to me how to execute this command? Is it supposed to be in a python command prompt or something else? When I copy and paste their exact html and javascript page code and use the premade deps.js file for the guide, my page doesn't function with keyboard navigation, so I'm assuming the deps.js file is my problem because everything else is exactly from the guide.

ejfrancis
  • 2,925
  • 4
  • 26
  • 42

1 Answers1

2

You will need to have python installed on your development machine and make sure that it is added to your path environment. The closure depswriter can be executed by using python from the command line (if you are using *nix then you can just invoke the file from the cli). Try:

python WHERE-YOU-UNZIPPED-THE-ZIP-PATH/gtv-ui-lib/closure-library/closure/bin/build/depswriter.py \
  --root_with_prefix="gtv-ui-lib/source ../../../../gtv-ui-lib/source" \
  --output_file=tv-deps.js

I would also recommend checking out the source from the SVN repo and not using the github zip file. The SVN repo is the most upto date and the github is a mirror that can sometimes fall behind. To ensure you have the latest version of the code do install the SVN tools and checkout from the specified repo.

Krispy
  • 1,098
  • 1
  • 7
  • 11
  • yeah i just gave up on doing it in windows and ended up using ubuntu for the ease of command line use for svn and python execution. also, i think the zip package i had wasn't fully correct, so you were right to suggest using the svn repo. i've now finally got a working (albeit basic) page with keyboard navigation. once everything is all set and working, the closure library seems much easier than google's jquery UI library because of its simple use of CSS classes – ejfrancis Dec 28 '12 at 20:28