launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #16076
[Merge] lp:~andreserl/maas/maas_saucy_fix_commissioning into lp:~maas-maintainers/maas/packaging
Andres Rodriguez has proposed merging lp:~andreserl/maas/maas_saucy_fix_commissioning into lp:~maas-maintainers/maas/packaging.
Commit message:
Fix commissioning by reloading initctl configuration on the commissioning scripts, otherwise it will fail to start causing commissioning to fail.
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~andreserl/maas/maas_saucy_fix_commissioning/+merge/190239
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~andreserl/maas/maas_saucy_fix_commissioning/+merge/190239
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~andreserl/maas/maas_saucy_fix_commissioning into lp:~maas-maintainers/maas/packaging.
=== added file '.bzrignore'
--- .bzrignore 1970-01-01 00:00:00 +0000
+++ .bzrignore 2013-10-09 20:38:29 +0000
@@ -0,0 +1,34 @@
+*.egg
+*.egg-info
+*.log
+./.coverage
+./.installed.cfg
+./.noseids
+./acceptance/*.build
+./acceptance/*.changes
+./acceptance/*.deb
+./acceptance/build
+./acceptance/source
+./bin
+./build
+./db
+./develop-eggs
+./dist
+./docs/_autosummary
+./docs/_build
+./docs/api.rst
+./eggs
+./include
+./lib
+./local
+./logs/*
+./man/.doctrees
+./media/demo/*
+./media/development
+./parts
+./run/*
+./services/*/supervise
+./src/maasserver/static/js/enums.js
+./TAGS
+./tags
+dropin.cache
=== added file '.ctags'
--- .ctags 1970-01-01 00:00:00 +0000
+++ .ctags 2013-10-09 20:38:29 +0000
@@ -0,0 +1,4 @@
+--python-kinds=-iv
+--exclude=*.js
+--extra=+f
+--links=yes
=== added symlink 'CHANGELOG'
=== target is u'docs/changelog.rst'
=== added file 'HACKING.txt'
--- HACKING.txt 1970-01-01 00:00:00 +0000
+++ HACKING.txt 2013-10-09 20:38:29 +0000
@@ -0,0 +1,478 @@
+.. -*- mode: rst -*-
+
+************
+Hacking MAAS
+************
+
+
+Coding style
+============
+
+MAAS follows the `Launchpad Python Style Guide`_, except where it gets
+Launchpad specific, and where it talks about `method naming`_. MAAS
+instead adopts `PEP-8`_ naming in all cases, so method names should
+usually use the ``lowercase_with_underscores`` form.
+
+.. _Launchpad Python Style Guide:
+ https://dev.launchpad.net/PythonStyleGuide
+
+.. _method naming:
+ https://dev.launchpad.net/PythonStyleGuide#Naming
+
+.. _PEP-8:
+ http://www.python.org/dev/peps/pep-0008/
+
+
+Prerequisites
+=============
+
+You can grab MAAS's code manually from Launchpad but Bazaar_ makes it
+easy to fetch the last version of the code. First of all, install
+Bazaar::
+
+ $ sudo apt-get install bzr
+
+.. _Bazaar: http://bazaar.canonical.com/
+
+Then go into the directory where you want the code to reside and run::
+
+ $ bzr branch lp:maas maas && cd maas
+
+MAAS depends on Postgres 9.1, RabbitMQ, Apache 2, Avahi, daemontools,
+pyinotify, and many other packages. To install everything that's
+needed for running and developing MAAS, run::
+
+ $ make install-dependencies
+
+Careful: this will ``apt-get install`` many packages on your system,
+via ``sudo``. It may prompt you for your password.
+
+This will install ``bind9``. As a result you will have an extra daemon
+running. If you are a developer and don't intend to run BIND locally,
+you can disable the daemon by inserting ``exit 1`` at the top of
+``/etc/default/bind9``. The package still needs to be installed for
+tests though.
+
+You may also need to install ``python-django-piston``, but installing
+it seems to cause import errors for ``oauth`` when running the test
+suite.
+
+All other development dependencies are pulled automatically from
+`PyPI`_ when ``buildout`` runs. See `First time using buildout?`_ and
+`Running tests`_.
+
+.. _PyPI:
+ http://pypi.python.org/
+
+
+First time using buildout?
+==========================
+
+Buildout_ is used to develop MAAS. Buildout, if configured so, can
+cache downloaded files and built eggs. If you've not already done
+something similar, the following snippet will massively improve build
+times::
+
+ [buildout]
+ download-cache = /home/<your-user-name>/.buildout/cache
+ eggs-directory = /home/<your-user-name>/.buildout/eggs
+
+Put this in ``~/.buildout/default.cfg`` and create the ``cache``
+directory::
+
+ $ mkdir /home/<your-user-name>/.buildout/cache
+
+The ``eggs`` directory will be created automatically.
+
+.. _Buildout:
+ http://www.buildout.org/
+
+
+Running tests
+=============
+
+To run the whole suite::
+
+ $ make test
+
+To run tests at a lower level of granularity::
+
+ $ ./bin/maas test src/maasserver/tests/test_api.py
+ $ ./bin/maas test src/maasserver/tests/test_api.py:AnonymousEnlistmentAPITest
+
+The test runner is `nose`_, so you can pass in options like
+``--with-coverage`` and ``--nocapture`` (short option: ``-s``). The
+latter is essential when using ``pdb`` so that stdout is not
+adulterated.
+
+.. _nose: http://readthedocs.org/docs/nose/en/latest/
+
+
+Running JavaScript tests
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+The JavaScript tests are run using Selenium_. Firefox is the default
+browser but any browser supported by Selenium can be used to run the
+tests. Note that you might need to download the appropriate driver and
+make it available in the path. You can then choose which browsers to use by
+setting the environment variable ``MAAS_TEST_BROWSERS`` to a comma-separated
+list of the names of the browsers to use. For instance, to run the tests
+with Firefox and Chrome::
+
+ $ export MAAS_TEST_BROWSERS="Firefox, Chrome"
+
+.. _Selenium: http://seleniumhq.org/
+
+
+Running JavaScript tests with browsers on other platforms
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The JavaScript tests can be run using the `SauceLabs' OnDemand`_
+service. There is a free version of this that provides 45 minutes a
+month of testing. To get started, `sign up`_ and go to your `account
+page`_, select the *Account* tab, and click *View my API Key*. Now
+save your credentials::
+
+ $ mkdir -p ~/.saucelabs/connect
+ $ chmod go-rwx ~/.saucelabs/connect
+ $ echo "${username} ${api_key}" > ~/.saucelabs/connect/credentials
+
+(You need to substitute your SauceLabs username and API key above.)
+
+Next, like when running Selenium tests locally, you need to specify
+the browsers to run on. At the time of writing there are four to
+choose from, all running on a Windows host::
+
+ $ export MAAS_REMOTE_TEST_BROWSERS="IE7, IE8, IE9, Chrome"
+
+By default, when ``MAAS_REMOTE_TEST_BROWSERS`` is not specified,
+testing via OnDemand is *not* attempted.
+
+.. _SauceLabs' OnDemand: http://saucelabs.com/
+
+.. _sign up: http://saucelabs.com/pricing
+
+.. _account page: https://saucelabs.com/account
+
+
+Development MAAS server setup
+=============================
+
+Access to the database is configured in ``src/maas/development.py``.
+
+The ``Makefile`` or the test suite sets up a development database
+cluster inside your branch. It lives in the ``db`` directory, which
+gets created on demand. You'll want to shut it down before deleting a
+branch; see below.
+
+First, set up the project. This fetches all the required dependencies
+and sets up some useful commands in ``bin/``::
+
+ $ make
+
+Create the database cluster and initialize the development database::
+
+ $ make syncdb
+
+Optionally, populate your database with the sample data::
+
+ $ make sampledata
+
+By default, the snippet ``maas_proxy`` includes a definition for an http
+proxy running on port 8000 on the same host as the MAAS server. This
+means you can *either* install ``squid-deb-proxy``::
+
+ $ sudo apt-get install squid-deb-proxy
+
+*or* you can edit ``contrib/snippets_v2/generic`` to remove the proxy
+definition.
+
+Set the iSCSI config to include the MAAS configs::
+
+ $ sudo tee -a /etc/tgt/targets.conf < contrib/tgt.conf
+
+The http_proxy variable is only needed if you're downloading through a
+proxy; "sudo" wouldn't pass it on to the script without the assignment.
+Or if you don't have it set but do want to download through a proxy, pass
+your proxy's URL: "http_proxy=http://proxy.example.com/"
+
+Run the development webserver and watch all the logs go by::
+
+ $ make run
+
+Point your browser to http://localhost:5240/
+
+If you've populated your instance with the sample data, you can login as a
+simple user using the test account (username: 'test', password: 'test') or the
+admin account (username: 'admin', password: 'test').
+
+At this point you may also want to `download PXE boot resources`_.
+
+.. _`download PXE boot resources`: `Downloading PXE boot resources`_
+
+To shut down the database cluster and clean up all other generated files in
+your branch::
+
+ $ make distclean
+
+
+Downloading PXE boot resources
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+To use PXE booting, each cluster controller needs to download several
+files relating to PXE booting. This process is automated, but it does
+not start by default.
+
+First create a superuser and start all MAAS services::
+
+ $ bin/maas createsuperuser
+ $ make run
+
+Get the superuser's API key on the `account preferences`_ page in web
+UI, and use it to log into MAAS at the command-line::
+
+ $ bin/maascli login dev http://localhost:5240
+
+.. _`account preferences`: http://localhost:5240/account/prefs/
+
+Start downloading PXE boot resources::
+
+ $ bin/maascli dev node-groups import-boot-images
+
+This sends jobs to each cluster controller, asking each to download
+the boot resources they require. This may download dozens or hundreds
+of megabytes, so it may take a while. To save bandwidth, set an HTTP
+proxy beforehand::
+
+ $ bin/maascli dev maas set-config name=http_proxy value=http://...
+
+
+Running the built-in TFTP server
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+You will need to run the built-in TFTP server on the real TFTP port (69) if
+you want to boot some real hardware. By default, it's set to start up on
+port 5244 for testing purposes. Make these changes::
+
+ * Edit ``etc/maas/pserv.yaml`` to change the tftp/port setting to 69
+ * Install the ``authbind``package:
+
+ $ sudo apt-get install authbind
+
+ * Create a file ``/etc/authbind/byport/69`` that is *executable* by the
+ user running MAAS.
+
+ $ sudo touch /etc/authbind/byport/69
+ $ sudo chmod a+x /etc/authbind/byport/69
+
+Now when starting up the MAAS development webserver, "make run" and "make
+start" will detect authbind's presence and use it automatically.
+
+
+Running the BIND daemon for real
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+There's a BIND daemon that is started up as part of the development service
+but it runs on port 5246 by default. If you want to make it run as a real
+DNS server on the box then edit ``services/dns/run`` and change the port
+declaration there so it says::
+
+ port=53
+
+Then as for TFTP above, create an authbind authorisation::
+
+ $ sudo touch /etc/authbind/byport/53
+ $ sudo chmod a+x /etc/authbind/byport/53
+
+and run as normal.
+
+
+Configuring DHCP
+^^^^^^^^^^^^^^^^
+
+MAAS requires a properly configured DHCP server so it can boot machines using
+PXE. MAAS can work with its own instance of the ISC DHCP server, if you
+install the maas-dhcp package::
+
+ $ sudo apt-get install maas-dhcp
+
+If you choose to run your own ISC DHCP server, there is a bit more
+configuration to do. First, run this tool to generate a configuration that
+will work with MAAS::
+
+ $ maas-provision generate-dhcp-config [options]
+
+Run ``maas-provision generate-dhcp-config -h`` to see the options. You will
+need to provide various IP details such as the range of IP addresses to assign
+to clients. You can use the generated output to configure your system's ISC
+DHCP server, by inserting the configuration in the ``/etc/dhcp/dhcpd.conf``
+file.
+
+Also, edit /etc/default/isc-dhcp-server to set the INTERFACES variable to just
+the network interfaces that should be serviced by this DHCP server.
+
+Now restart dhcpd::
+
+ $ sudo service isc-dhcp-server restart
+
+None of this work is needed if you let MAAS run its own DHCP server by
+installing ``maas-dhcp``.
+
+
+Development services
+====================
+
+The development environment uses *daemontools* to manage the various
+services that are required. These are all defined in subdirectories in
+``services/``.
+
+There are familiar service-like commands::
+
+ $ make start
+ $ make status
+ $ make restart
+ $ make stop
+
+The latter is a dependency of ``distclean`` so just running ``make
+distclean`` when you've finished with your branch is enough to stop
+everything.
+
+Individual services can be manipulated too::
+
+ $ make services/pserv/@start
+
+The ``@<action>`` pattern works for any of the services.
+
+There's an additional special action, ``run``::
+
+ $ make run
+
+This starts all services up and tails their log files. When you're
+done, kill ``tail`` (e.g. Ctrl-c), and all the services will be
+stopped.
+
+However, when used with individual services::
+
+ $ make services/webapp/@run
+
+it does something even cooler. First it shuts down the service, then
+it restarts it in the foreground so you can see the logs in the
+console. More importantly, it allows you to use ``pdb``, for example.
+
+A note of caution: some of the services have slightly different
+behaviour when run in the foreground:
+
+* Django (the *webapp* service) will be run with its auto-reloading
+ enabled.
+
+* Apache (the *web* service) will run with ``-X``, which puts it in
+ debug mode: only one worker will be started and the server will not
+ detach from the console.
+
+There's a convenience target for hacking Django that starts everything
+up, but with Django in the foreground::
+
+ $ make run+webapp
+
+Apparently Django needs a lot of debugging ;)
+
+
+Adding new dependencies
+=======================
+
+Since MAAS is distributed mainly as an Ubuntu package, all runtime
+dependencies should be packaged, and we should develop with the
+packaged version if possible. All dependencies, from a package or not,
+need to be added to ``setup.py`` and ``buildout.cfg``, and the version
+specified in ``versions.cfg`` (``allowed-picked-version`` is disabled,
+hence ``buildout`` must be given precise version information).
+
+If it is a development-only dependency (i.e. only needed for the test suite, or
+for developers' convenience), simply running ``buildout`` like this will make
+the necessary updates to ``versions.cfg``::
+
+ $ ./bin/buildout -v buildout:allow-picked-versions=true
+
+
+Adding new source files
+=======================
+
+When creating a new source file, a Python module or test for example,
+always start with the appropriate template from the ``templates``
+directory.
+
+
+Database schema changes
+=======================
+
+MAAS uses South_ to manage changes to the database schema.
+
+.. _South: http://south.aeracode.org
+
+Be sure to have a look at `South's documentation`_ before you make any change.
+
+.. _South's documentation: http://south.aeracode.org/docs/
+
+
+Changing the schema
+^^^^^^^^^^^^^^^^^^^
+
+Once you've made a model change (i.e. a change to a file in
+``src/<application>/models/*.py``) you have to run South's `schemamigration`_
+command to create a migration file that will be stored in
+``src/<application>/migrations/``.
+
+Note that if you want to add a new model class you'll need to import it
+in ``src/<application>/models/__init__.py``
+
+.. _schemamigration: http://south.aeracode.org/docs/commands.html#schemamigration
+
+Once you've changed the code, run::
+
+ $ ./bin/maas schemamigration maasserver --auto description_of_the_change
+
+This will generate a migration module named
+``src/maasserver/migrations/<auto_number>_description_of_the_change.py``. Don't
+forget to add that file to the project with::
+
+ $ bzr add src/maasserver/migrations/<auto_number>_description_of_the_change.py
+
+To apply that migration, run::
+
+ $ make syncdb
+
+
+Performing data migration
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+If you need to perform data migration, very much in the same way, you will need
+to run South's `datamigration`_ command. For instance, if you want to perform
+changes to the ``maasserver`` application, run::
+
+ $ ./bin/maas datamigration maasserver description_of_the_change
+
+.. _datamigration: http://south.aeracode.org/docs/commands.html#datamigration
+
+This will generate a migration module named
+``src/maasserver/migrations/<auto_number>_description_of_the_change.py``.
+You will need to edit that file and fill the ``forwards`` and ``backwards``
+methods where data should be actually migrated. Again, don't forget to
+add that file to the project::
+
+ $ bzr add src/maasserver/migrations/<auto_number>_description_of_the_change.py
+
+Once the methods have been written, apply that migration with::
+
+ $ make syncdb
+
+
+Documentation
+=============
+
+Use `reST`_ with the `convention for headings as used in the Python
+documentation`_.
+
+.. _reST: http://sphinx.pocoo.org/rest.html
+
+.. _convention for headings as used in the Python documentation:
+ http://sphinx.pocoo.org/rest.html#sections
=== added file 'INSTALL.txt'
--- INSTALL.txt 1970-01-01 00:00:00 +0000
+++ INSTALL.txt 2013-10-09 20:38:29 +0000
@@ -0,0 +1,269 @@
+.. -*- mode: rst -*-
+
+
+Installing MAAS
+===============
+
+There are two main ways to install MAAS
+
+ * :ref:`From Ubuntu's package archive on an existing Ubuntu
+ install. <pkg-install>`
+ * :ref:`As a fresh install from Ubuntu Server install
+ media. <disc-install>`
+
+If you are interested in testing the latest development version you
+can also check out the very latest source and build MAAS yourself.
+
+
+.. _pkg-install:
+
+Installing MAAS from the archive
+--------------------------------
+
+Installing MAAS from packages is thankfully straightforward. There are
+actually several packages that go into making up a working MAAS
+install, but for convenience, many of these have been gathered into a
+virtual package called 'maas' which will install the necessary
+components for a 'seed cloud', that is a single server that will
+directly control a group of nodes. The main packages are:
+
+ * ``maas`` - seed cloud setup, which includes both the region
+ controller and the cluster controller below.
+ * ``maas-region-controller`` - includes the web UI, API and database.
+ * ``maas-cluster-controller`` - controls a group ("cluster") of nodes
+ including DHCP management.
+ * ``maas-dhcp``/``maas-dns`` - required when managing dhcp/dns.
+
+If you need to separate these services or want to deploy an additional
+cluster controller, you should install the corresponding packages
+individually (see :ref:`the description of a typical setup <setup>`
+for more background on how a typical hardware setup might be
+arranged).
+
+There are two suggested additional packages 'maas-dhcp' and
+'maas-dns'. These set up MAAS-controlled DHCP and DNS services which
+greatly simplify deployment if you are running a typical setup where
+the MAAS controller can run the network (Note: These **must** be
+installed if you later set the options in the web interface to have
+MAAS manage DHCP/DNS). If you need to integrate your MAAS setup under
+an existing DHCP setup, see :ref:`manual-dhcp`
+
+
+Install packages
+^^^^^^^^^^^^^^^^
+
+At the command-line, type::
+
+ $ sudo apt-get install maas maas-dhcp maas-dns
+
+You will see a list of packages and a confirmation message to
+proceed. The exact list will obviously depend on what you already have
+installed on your server, but expect to add about 200MB of files.
+
+The configuration for the MAAS controller will automatically run and
+pop up this config screen:
+
+.. image:: media/install_cluster-config.*
+
+Here you will need to enter the hostname for where the region
+controller can be contacted. In many scenarios, you may be running the
+region controller (i.e. the web and API interface) from a different
+network address, for example where a server has several network
+interfaces.
+
+Once the configuration scripts have run you should see this message
+telling you that the system is ready to use:
+
+.. image:: media/install_controller-config.*
+
+The web server is started last, so you have to accept this message
+before the service is run and you can access the Web interface. Then
+there are just a few more setup steps :ref:`post_install`
+
+
+.. _disc-install:
+
+Installing MAAS from Ubuntu Server boot media
+---------------------------------------------
+
+If you are installing MAAS as part of a fresh install it is easiest to
+choose the "Multiple Server install with MAAS" option from the
+installer and have pretty much everything set up for you. Boot from
+the Ubuntu Server media and you will be greeted with the usual
+language selection screen:
+
+.. image:: media/install_01.*
+
+On the next screen, you will see there is an entry in the menu called
+"Multiple server install with MAAS". Use the cursor keys to select
+this and then press Enter.
+
+.. image:: media/install_02.*
+
+The installer then runs through the usual language and keyboard
+options. Make your selections using Tab/Cursor keys/Enter to proceed
+through the install. The installer will then load various drivers,
+which may take a moment or two.
+
+.. image:: media/install_03.*
+
+The next screen asks for the hostname for this server. Choose
+something appropriate for your network.
+
+.. image:: media/install_04.*
+
+Finally we get to the MAAS part! Here there are just two options. We
+want to "Create a new MAAS on this server" so go ahead and choose that
+one.
+
+.. image:: media/install_05.*
+
+The install now continues as usual. Next you will be prompted to enter
+a username. This will be the admin user for the actual server that
+MAAS will be running on (not the same as the MAAS admin user!)
+
+.. image:: media/install_06.*
+
+As usual you will have the chance to encrypt your home
+directory. Continue to make selections based on whatever settings suit
+your usage.
+
+.. image:: media/install_07.*
+
+After making selections and partitioning storage, the system software
+will start to be installed. This part should only take a few minutes.
+
+.. image:: media/install_09.*
+
+Various packages will now be configured, including the package manager
+and update manager. It is important to set these up appropriately so
+you will receive timely updates of the MAAS server software, as well
+as other essential services that may run on this server.
+
+.. image:: media/install_10.*
+
+The configuration for MAAS will ask you to configure the host address
+of the server. This should be the IP address you will use to connect
+to the server (you may have additional interfaces e.g. to run node
+subnets)
+
+.. image:: media/install_cluster-config.*
+
+The next screen will confirm the web address that will be used to the
+web interface.
+
+.. image:: media/install_controller-config.*
+
+After configuring any other packages the installer will finally come
+to and end. At this point you should eject the boot media.
+
+.. image:: media/install_14.*
+
+After restarting, you should be able to login to the new server with
+the information you supplied during the install. The MAAS software
+will run automatically.
+
+.. image:: media/install_15.*
+
+**NOTE:** The maas-dhcp and maas-dns packages are not installed by
+default. If you want to have MAAS run DHCP and DNS services, you
+should install these packages::
+
+ $ sudo apt-get install maas-dhcp maas-dns
+
+And then proceed to the post-install setup below.
+
+.. _post_install:
+
+
+Post-Install tasks
+==================
+
+If you now use a web browser to connect to the region controller, you
+should see that MAAS is running, but there will also be some errors on
+the screen:
+
+.. image:: media/install_web-init.*
+
+The on screen messages will tell you that there are no boot images
+present, and that you can't login because there is no admin user.
+
+
+Create a superuser account
+--------------------------
+
+Once MAAS is installed, you'll need to create an administrator
+account::
+
+ $ sudo maas createsuperuser
+
+Follow the prompts to create the account which you will need to login
+to the web interface. Unless you have a special need, it is best to
+accept the default login name of `root`, as it is rather annoying if
+you forget the username (although you can simply run this command
+again to create a new superuser).
+
+
+Import the boot images
+----------------------
+
+MAAS will check for and download new Ubuntu images once a week.
+However, you'll need to download them manually the first time. To do
+this you will need to connect to the MAAS API using the maas-cli
+tool. (see :ref:`Logging in <api-key>` for details). Then you need to
+run the command::
+
+ $ maas-cli maas node-groups import-boot-images
+
+(substitute in a different profile name for 'maas' if you have called
+yours something else) This will initiate downloading the required
+image files. Note that this may take some time depending on your
+network connection.
+
+
+Login to the server
+-------------------
+
+To check that everything is working properly, you should try and login
+to the server now. Both the error messages should have gone (it can
+take a few minutes for the boot image files to register) and you can
+see that there are currently 0 nodes attached to this controller.
+
+.. image:: media/install-login.*
+
+
+Configure DHCP
+--------------
+
+If you want MAAS to control DHCP, you can either:
+
+#. Follow the instructions at :doc:`cluster-configuration` to
+ use the web UI to set up your cluster controller.
+
+#. Use the command line interface `maas-cli` by first
+ :ref:`logging in to the API <api-key>` and then
+ :ref:`following this procedure <cli-dhcp>`
+
+If you are manually configuring a DHCP server, you should take a look at
+:ref:`manual-dhcp`
+
+
+Configure switches on the network
+---------------------------------
+
+Some switches use Spanning-Tree Protocol (STP) to negotiate a loop-free path
+through a root bridge. While scanning, it can make each port wait up to 50
+seconds before data is allowed to be sent on the port. This delay in turn can
+cause problems with some applications/protocols such as PXE, DHCP and DNS, of
+which MAAS makes extensive use.
+
+To alleviate this problem, you should enable `Portfast`_ for Cisco switches
+or its equivalent on other vendor equipment, which enables the ports to come
+up almost immediately.
+
+.. _Portfast:
+ https://www.symantec.com/business/support/index?page=content&id=HOWTO6019
+
+
+Once everything is set up and running, you are ready to :doc:`start
+enlisting nodes <nodes>`
=== added file 'LICENSE'
--- LICENSE 1970-01-01 00:00:00 +0000
+++ LICENSE 2013-10-09 20:38:29 +0000
@@ -0,0 +1,676 @@
+MAAS is Copyright 2012 Canonical Ltd.
+
+Canonical Ltd ("Canonical") distributes the MAAS source code
+under the GNU Affero General Public License, version 3 ("AGPLv3").
+The full text of this licence is given below.
+
+Third-party copyright in this distribution is noted where applicable.
+
+All rights not expressly granted are reserved.
+
+=========================================================================
+
+ GNU AFFERO GENERAL PUBLIC LICENSE
+ Version 3, 19 November 2007
+ (http://www.gnu.org/licenses/agpl.html)
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU Affero General Public License is a free, copyleft license for
+software and other kinds of works, specifically designed to ensure
+cooperation with the community in the case of network server software.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+our General Public Licenses are intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ Developers that use our General Public Licenses protect your rights
+with two steps: (1) assert copyright on the software, and (2) offer
+you this License which gives you legal permission to copy, distribute
+and/or modify the software.
+
+ A secondary benefit of defending all users' freedom is that
+improvements made in alternate versions of the program, if they
+receive widespread use, become available for other developers to
+incorporate. Many developers of free software are heartened and
+encouraged by the resulting cooperation. However, in the case of
+software used on network servers, this result may fail to come about.
+The GNU General Public License permits making a modified version and
+letting the public access it on a server without ever releasing its
+source code to the public.
+
+ The GNU Affero General Public License is designed specifically to
+ensure that, in such cases, the modified source code becomes available
+to the community. It requires the operator of a network server to
+provide the source code of the modified version running there to the
+users of that server. Therefore, public use of a modified version, on
+a publicly accessible server, gives the public access to the source
+code of the modified version.
+
+ An older license, called the Affero General Public License and
+published by Affero, was designed to accomplish similar goals. This is
+a different license, not a version of the Affero GPL, but Affero has
+released a new version of the Affero GPL which permits relicensing under
+this license.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU Affero General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Remote Network Interaction; Use with the GNU General Public License.
+
+ Notwithstanding any other provision of this License, if you modify the
+Program, your modified version must prominently offer all users
+interacting with it remotely through a computer network (if your version
+supports such interaction) an opportunity to receive the Corresponding
+Source of your version by providing access to the Corresponding Source
+from a network server at no charge, through some standard or customary
+means of facilitating copying of software. This Corresponding Source
+shall include the Corresponding Source for any work covered by version 3
+of the GNU General Public License that is incorporated pursuant to the
+following paragraph.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the work with which it is combined will remain governed by version
+3 of the GNU General Public License.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU Affero General Public License from time to time. Such new versions
+will be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU Affero General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU Affero General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU Affero General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+state the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If your software can interact with users remotely through a computer
+network, you should also make sure that it provides a way for users to
+get its source. For example, if your program is a web application, its
+interface could display a "Source" link that leads users to an archive
+of the code. There are many ways you could offer source, and different
+solutions will be better for different programs; see section 13 for the
+specific requirements.
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU AGPL, see
+<http://www.gnu.org/licenses/>.
+
+=========================================================================
=== added file 'MANIFEST.in'
--- MANIFEST.in 1970-01-01 00:00:00 +0000
+++ MANIFEST.in 2013-10-09 20:38:29 +0000
@@ -0,0 +1,10 @@
+graft src/*/static
+graft src/*/templates
+graft src/*/fixtures
+graft src/*/specs
+graft src/provisioningserver/*
+graft src/metadataserver/commissioning
+prune src/*/testing
+prune src/*/tests
+prune src/maastesting
+prune src/provisioningserver/*/tests
=== added file 'Makefile'
--- Makefile 1970-01-01 00:00:00 +0000
+++ Makefile 2013-10-09 20:38:29 +0000
@@ -0,0 +1,330 @@
+python := python2.7
+
+# Network activity can be suppressed by setting offline=true (or any
+# non-empty string) at the command-line.
+ifeq ($(offline),)
+buildout := bin/buildout
+virtualenv := virtualenv
+else
+buildout := bin/buildout buildout:offline=true
+virtualenv := virtualenv --never-download
+endif
+
+# If offline has been selected, attempt to further block HTTP/HTTPS
+# activity by setting bogus proxies in the environment.
+ifneq ($(offline),)
+export http_proxy := broken
+export https_proxy := broken
+endif
+
+# Python enum modules.
+py_enums := $(wildcard src/*/enum.py)
+# JavaScript enum module (not modules).
+js_enums := src/maasserver/static/js/enums.js
+
+# Prefix commands with this when they need access to the database.
+# Remember to add a dependency on bin/database from the targets in
+# which those commands appear.
+dbrun := bin/database --preserve run --
+
+# For things that care, postgresfixture for example, we always want to
+# use the "maas" databases.
+export PGDATABASE := maas
+
+build: \
+ bin/buildout \
+ bin/database \
+ bin/maas bin/test.maas \
+ bin/maascli bin/test.maascli \
+ bin/test.maastesting \
+ bin/twistd.pserv bin/test.pserv \
+ bin/twistd.txlongpoll \
+ bin/py bin/ipy \
+ $(js_enums)
+
+all: build doc
+
+# Install all packages required for MAAS development & operation on
+# the system. This may prompt for a password.
+install-dependencies:
+ sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
+ --no-install-recommends install $(shell sort -u \
+ $(addprefix required-packages/,base dev doc))
+
+bin/python bin/pip:
+ $(virtualenv) --python=$(python) --system-site-packages $(CURDIR)
+
+bin/buildout: bin/pip bootstrap/zc.buildout-1.5.2.tar.gz
+ bin/pip --quiet install --ignore-installed \
+ --no-dependencies bootstrap/zc.buildout-1.5.2.tar.gz
+ $(RM) -f README.txt # zc.buildout installs an annoying README.txt.
+ @touch --no-create $@ # Ensure it's newer than its dependencies.
+
+bin/database: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install database
+ @touch --no-create $@
+
+bin/maas: bin/buildout buildout.cfg versions.cfg setup.py $(js_enums)
+ $(buildout) install maas
+ @touch --no-create $@
+
+bin/test.maas: bin/buildout buildout.cfg versions.cfg setup.py $(js_enums)
+ $(buildout) install maas-test
+ @touch --no-create $@
+
+bin/maascli: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install maascli
+ @touch --no-create $@
+
+bin/test.maascli: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install maascli-test
+ @touch --no-create $@
+
+bin/test.maastesting: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install maastesting-test
+ @touch --no-create $@
+
+bin/celeryd bin/maas-provision bin/twistd.pserv: \
+ bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install pserv
+ @touch --no-create $@
+
+bin/test.pserv: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install pserv-test
+ @touch --no-create $@
+
+bin/twistd.txlongpoll: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install txlongpoll
+ @touch --no-create $@
+
+bin/flake8: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install flake8
+ @touch --no-create $@
+
+bin/sphinx bin/sphinx-build: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install sphinx
+ @touch --no-create $@
+
+bin/py bin/ipy: bin/buildout buildout.cfg versions.cfg setup.py
+ $(buildout) install repl
+ @touch --no-create bin/py bin/ipy
+
+test: build
+ echo $(wildcard bin/test.*) | xargs -n1 env
+
+lint: sources = $(wildcard *.py contrib/*.py) src templates twisted utilities
+lint: bin/flake8
+ @find $(sources) -name '*.py' ! -path '*/migrations/*' \
+ -print0 | xargs -r0 bin/flake8
+
+pocketlint = $(call available,pocketlint,python-pocket-lint)
+
+lint-css: sources = src/maasserver/static/css
+lint-css:
+ @find $(sources) -type f \
+ -print0 | xargs -r0 $(pocketlint) --max-length=120
+
+lint-js: sources = src/maasserver/static/js
+lint-js:
+ @find $(sources) -type f -print0 | xargs -r0 $(pocketlint)
+
+check: clean test
+
+docs/api.rst: bin/maas src/maasserver/api.py syncdb
+ bin/maas generate_api_doc > $@
+
+sampledata: bin/maas bin/database syncdb
+ $(dbrun) bin/maas loaddata src/maasserver/fixtures/dev_fixture.yaml
+
+doc: bin/sphinx docs/api.rst
+ bin/sphinx
+
+man: $(patsubst docs/man/%.rst,man/%,$(wildcard docs/man/*.rst))
+
+man/%: docs/man/%.rst | bin/sphinx-build
+ bin/sphinx-build -b man docs man $^
+
+enums: $(js_enums)
+
+$(js_enums): bin/py src/maasserver/utils/jsenums.py $(py_enums)
+ bin/py -m src/maasserver/utils/jsenums $(py_enums) > $@
+
+clean:
+ $(MAKE) -C acceptance $@
+ find . -type f -name '*.py[co]' -print0 | xargs -r0 $(RM)
+ find . -type f -name '*~' -print0 | xargs -r0 $(RM)
+ find . -type f -name dropin.cache -print0 | xargs -r0 $(RM)
+ $(RM) -r media/demo/* media/development
+ $(RM) $(js_enums)
+ $(RM) *.log
+ $(RM) docs/api.rst
+ $(RM) -r docs/_autosummary docs/_build
+ $(RM) -r man/.doctrees
+
+distclean: clean stop
+ $(RM) -r bin include lib local
+ $(RM) -r eggs develop-eggs
+ $(RM) -r build dist logs/* parts
+ $(RM) tags TAGS .installed.cfg
+ $(RM) -r *.egg *.egg-info src/*.egg-info
+ $(RM) -r run/* services/*/supervise
+
+harness: bin/maas bin/database
+ $(dbrun) bin/maas shell --settings=maas.demo
+
+dbharness: bin/database
+ bin/database --preserve shell
+
+syncdb: bin/maas bin/database
+ $(dbrun) bin/maas syncdb --noinput
+ $(dbrun) bin/maas migrate maasserver --noinput
+ $(dbrun) bin/maas migrate metadataserver --noinput
+
+define phony_targets
+ build
+ check
+ clean
+ dbharness
+ distclean
+ doc
+ enums
+ harness
+ install-dependencies
+ lint
+ lint-css
+ lint-js
+ man
+ sampledata
+ syncdb
+ test
+endef
+
+#
+# Development services.
+#
+
+service_names_region := database dns region-worker reloader txlongpoll web webapp
+service_names_cluster := cluster-worker pserv reloader
+service_names_all := $(service_names_region) $(service_names_cluster)
+
+# The following template is intended to be used with `call`, and it
+# accepts a single argument: a target name. The target name must
+# correspond to a service action (see "Pseudo-magic targets" below).
+# A region- and cluster-specific variant of the target will be
+# created, in addition to the target itself. These can be used to
+# apply the service action to the region services, the cluster
+# services, or all services, at the same time.
+define service_template
+$(1)-region: $(patsubst %,services/%/@$(1),$(service_names_region))
+$(1)-cluster: $(patsubst %,services/%/@$(1),$(service_names_cluster))
+$(1): $(1)-region $(1)-cluster
+phony_services_targets += $(1)-region $(1)-cluster $(1)
+endef
+
+# Expand out aggregate service targets using `service_template`.
+$(eval $(call service_template,pause))
+$(eval $(call service_template,restart))
+$(eval $(call service_template,start))
+$(eval $(call service_template,status))
+$(eval $(call service_template,stop))
+$(eval $(call service_template,supervise))
+
+# The `run` targets do not fit into the mould of the others.
+run-region:
+ @services/run $(service_names_region)
+run-cluster:
+ @services/run $(service_names_cluster)
+run:
+ @services/run $(service_names_all)
+
+phony_services_targets += run-region run-cluster run
+
+# This one's for the rapper, yo.
+run+webapp:
+ @services/run $(service_names_region) +webapp
+
+phony_services_targets += run+webapp
+
+# Convenient variables and functions for service control.
+
+setlock = $(call available,setlock,daemontools)
+supervise = $(call available,supervise,daemontools)
+svc = $(call available,svc,daemontools)
+svok = $(call available,svok,daemontools)
+svstat = $(call available,svstat,daemontools)
+
+service_lock = $(setlock) -n /run/lock/maas.dev.$(firstword $(1))
+
+# Pseudo-magic targets for controlling individual services.
+
+services/%/@run: services/%/@stop services/%/@deps
+ @$(call service_lock, $*) services/$*/run
+
+services/%/@start: services/%/@supervise
+ @$(svc) -u $(@D)
+
+services/%/@pause: services/%/@supervise
+ @$(svc) -d $(@D)
+
+services/%/@status:
+ @$(svstat) $(@D)
+
+services/%/@restart: services/%/@supervise
+ @$(svc) -du $(@D)
+
+services/%/@stop:
+ @if $(svok) $(@D); then $(svc) -dx $(@D); fi
+ @while $(svok) $(@D); do sleep 0.1; done
+
+services/%/@supervise: services/%/@deps
+ @mkdir -p logs/$*
+ @touch $(@D)/down
+ @if ! $(svok) $(@D); then \
+ logdir=$(CURDIR)/logs/$* \
+ $(call service_lock, $*) $(supervise) $(@D) & fi
+ @while ! $(svok) $(@D); do sleep 0.1; done
+
+# Dependencies for individual services.
+
+services/dns/@deps: bin/py
+
+services/cluster-worker/@deps: bin/celeryd
+
+services/region-worker/@deps: bin/celeryd
+
+services/database/@deps: bin/database
+
+services/pserv/@deps: bin/twistd.pserv
+
+services/reloader/@deps:
+
+services/txlongpoll/@deps: bin/twistd.txlongpoll
+
+services/web/@deps:
+
+services/webapp/@deps: bin/maas
+
+#
+# Phony stuff.
+#
+
+define phony
+ $(phony_services_targets)
+ $(phony_targets)
+endef
+
+phony := $(sort $(strip $(phony)))
+
+.PHONY: $(phony)
+
+#
+# Functions.
+#
+
+# Check if a command is found on PATH. Raise an error if not, citing
+# the package to install. Return the command otherwise.
+# Usage: $(call available,<command>,<package>)
+define available
+ $(if $(shell which $(1)),$(1),$(error $(1) not found; \
+ install it with 'sudo apt-get install $(2)'))
+endef
=== added file 'README'
--- README 1970-01-01 00:00:00 +0000
+++ README 2013-10-09 20:38:29 +0000
@@ -0,0 +1,33 @@
+.. -*- mode: rst -*-
+
+************************
+MAAS: Metal as a Service
+************************
+
+Metal as a Service -- MAAS -- lets you treat physical servers like
+virtual machines in the cloud. Rather than having to manage each
+server individually, MAAS turns your bare metal into an elastic
+cloud-like resource.
+
+What does that mean in practice? Tell MAAS about the machines you want
+it to manage and it will boot them, check the hardware's okay, and
+have them waiting for when you need them. You can then pull nodes up,
+tear them down and redeploy them at will; just as you can with virtual
+machines in the cloud.
+
+When you're ready to deploy a service, MAAS gives Juju the nodes it
+needs to power that service. It's as simple as that: no need to
+manually provision, check and, afterwards, clean-up. As your needs
+change, you can easily scale services up or down. Need more power for
+your Hadoop cluster for a few hours? Simply tear down one of your Nova
+compute nodes and redeploy it to Hadoop. When you're done, it's just
+as easy to give the node back to Nova.
+
+MAAS is ideal where you want the flexibility of the cloud, and the
+hassle-free power of Juju charms, but you need to deploy to bare
+metal.
+
+For more information see the `MAAS guide`_.
+
+.. _MAAS guide: https://maas.ubuntu.com/
+
=== added directory 'acceptance'
=== added file 'acceptance/Makefile'
--- acceptance/Makefile 1970-01-01 00:00:00 +0000
+++ acceptance/Makefile 2013-10-09 20:38:29 +0000
@@ -0,0 +1,155 @@
+#
+# Build and test everything in ephemeral containers:
+#
+# $ make
+#
+# Use a different packaging branch:
+#
+# $ make packaging=/path/to/branch
+#
+# Note: /path/to/branch can be anything that bzr recognises, so an lp:
+# link, or bzr+ssh, and so on.
+#
+# Build and test with a different Ubuntu series:
+#
+# $ make series=randy
+#
+
+include /etc/lsb-release
+
+# Default to the newer of Quantal or the local series.
+series := $(lastword $(sort quantal $(DISTRIB_CODENAME)))
+
+# Default to the main packaging branch on Launchpad, but treat Precise
+# specially.
+ifeq ($(series),precise)
+packaging := lp:~maas-maintainers/maas/packaging.precise
+else
+packaging := lp:~maas-maintainers/maas/packaging
+endif
+
+# Assume we're testing this branch.
+upstream := $(abspath ..)
+
+# The container on which to base ephemerals.
+container := maas-$(series)
+containerdir := /var/lib/lxc/$(container)
+
+## Convenience definitions.
+
+define ephexec
+sudo LC_ALL=C SSH_ASKPASS=$(abspath ubuntupass) setsid \
+ lxc-start-ephemeral -b $(upstream) -o $(container) -u ubuntu -- \
+ DEBIAN_FRONTEND=noninteractive SUDO_ASKPASS=$(abspath ubuntupass)
+endef
+
+define ephexec-make
+$(ephexec) $(abspath with-make) make -C $(abspath .)
+endef
+
+define check-service
+test $(2) = $(wordlist 2,2,$(shell initctl --system status $(1))) # $(1)
+endef
+
+## Top-level targets.
+
+test: build | services sudo container
+ $(ephexec-make) $@-inner
+
+# lxc-start-ephemeral does not return the exit code of any command it
+# runs, so we delete any existing packages before building and check
+# for their presence afterwards instead.
+build: source source/debian | services sudo container
+ @$(RM) *.deb
+ $(ephexec-make) $@-inner
+ @ls -1 *.deb
+ @touch $@
+
+container: $(containerdir)
+
+container-update: $(containerdir) | services sudo
+ $(abspath update-container) $(container)
+
+services:
+ $(call check-service,lxc,start/running)
+ $(call check-service,lxc-net,start/running)
+
+define phony-outer-targets
+ container
+ container-update
+ services
+ test
+endef
+
+## Targets that run within an LXC container.
+
+# XXX: These packages appear to be missing from the dependencies
+# declared in the packaging branch.
+define missing-packages
+ python-distribute
+ python-django
+endef
+
+test-inner: upgrade-inner
+ sudo -AE apt-get --assume-yes install $(strip $(missing-packages))
+ sudo -AE dpkg --unpack --force-depends -- *.deb
+ sudo -AE apt-get --fix-broken --assume-yes install
+
+define build-packages
+ debhelper
+ devscripts
+ dh-apport
+endef
+
+build-inner: | upgrade-inner
+ sudo -AE apt-get --assume-yes install $(strip $(missing-packages))
+ sudo -AE apt-get --assume-yes install $(strip $(build-packages))
+ cd source && debuild -i -us -uc -b
+
+upgrade-inner:
+ sudo -AE apt-get --assume-yes update
+ sudo -AE apt-get --assume-yes upgrade
+
+define phony-inner-targets
+ build-inner
+ test-inner
+ upgrade-inner
+endef
+
+## Dependencies.
+
+source:
+ bzr export --uncommitted $@ $(upstream)
+
+source/debian: | source
+ bzr export $@ $(packaging)/debian
+
+$(containerdir): | services sudo
+ sudo lxc-create -n $(container) \
+ -f /etc/lxc/default.conf -t ubuntu -- --release $(series)
+ $(abspath update-container) $(container)
+
+## Miscellaneous.
+
+sudo:
+ @sudo -v
+
+clean:
+ $(RM) -r source build *.build *.changes *.deb
+
+define phony-misc-targets
+ clean
+ sudo
+endef
+
+## Phony.
+
+define phony
+ $(phony-inner-targets)
+ $(phony-misc-targets)
+ $(phony-outer-targets)
+endef
+
+phony := $(sort $(strip $(phony)))
+
+.PHONY: $(phony)
=== added file 'acceptance/README'
--- acceptance/README 1970-01-01 00:00:00 +0000
+++ acceptance/README 2013-10-09 20:38:29 +0000
@@ -0,0 +1,13 @@
+MAAS Packaging Acceptance Testing
+---------------------------------
+
+The `test` make target will build binary packages for the current
+branch using the latest packaging branch from Launchpad, *in a clean
+ephemeral container*. The `build` target will install these packages
+in another clean ephemeral LXC container.
+
+Consider the `build-inner` and `test-inner` targets as bootstrap
+points for further work. It may not be suitable for full automated
+end-to-end testing of MAAS, so be clear about what you need to test
+before investing work here. OTOH, it is a good place to quickly test
+that the packages build, install and configure themselves as expected.
=== added file 'acceptance/ubuntupass'
--- acceptance/ubuntupass 1970-01-01 00:00:00 +0000
+++ acceptance/ubuntupass 2013-10-09 20:38:29 +0000
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+echo ubuntu
=== added file 'acceptance/update-container'
--- acceptance/update-container 1970-01-01 00:00:00 +0000
+++ acceptance/update-container 2013-10-09 20:38:29 +0000
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+# Copyright 2012 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+# Exit immediately if a command exits with a non-zero status.
+set -o errexit
+# Treat unset variables as an error when substituting.
+set -o nounset
+
+container="$1"
+
+start() {
+ echo -n Starting...
+ sudo lxc-start -n "${container}" --daemon
+ echo " done."
+}
+
+attach() {
+ sudo LC_ALL=C lxc-attach -n "${container}" -- "$@"
+}
+
+stop() {
+ echo -n Stopping...
+ sudo lxc-stop -n "${container}"
+ echo " done."
+}
+
+start && trap stop EXIT && {
+ sleep 5 # Allow container to get going.
+ attach sudo -AE apt-get --assume-yes update
+ attach sudo -AE apt-get --assume-yes dist-upgrade
+}
=== added file 'acceptance/with-make'
--- acceptance/with-make 1970-01-01 00:00:00 +0000
+++ acceptance/with-make 2013-10-09 20:38:29 +0000
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+# Copyright 2012 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+# Exit immediately if a command exits with a non-zero status.
+set -o errexit
+# Treat unset variables as an error when substituting.
+set -o nounset
+
+# Ensure that GNU make is installed.
+if ! sudo -AE apt-get install --assume-yes make
+then
+ # The installation of `make` may have failed because the package
+ # lists are out of date, so update them and try again.
+ sudo -AE apt-get update
+ sudo -AE apt-get install --assume-yes make
+fi
+
+exec "$@"
=== added directory 'bootstrap'
=== added file 'bootstrap/zc.buildout-1.5.2.tar.gz'
Binary files bootstrap/zc.buildout-1.5.2.tar.gz 1970-01-01 00:00:00 +0000 and bootstrap/zc.buildout-1.5.2.tar.gz 2013-10-09 20:38:29 +0000 differ
=== added file 'buildout.cfg'
--- buildout.cfg 1970-01-01 00:00:00 +0000
+++ buildout.cfg 2013-10-09 20:38:29 +0000
@@ -0,0 +1,203 @@
+[buildout]
+parts =
+ flake8
+ maas
+ maas-test
+ maascli
+ maascli-test
+ maastesting-test
+ pserv
+ pserv-test
+ repl
+ sphinx
+ txlongpoll
+extensions = buildout-versions
+buildout_versions_file = versions.cfg
+versions = versions
+extends = versions.cfg
+offline = false
+newest = false
+
+# Since MAAS's main deployment target is Ubuntu, all runtime
+# dependencies should come from python packages. However, it's okay
+# for development-time dependencies to come from eggs.
+include-site-packages = true
+
+prefer-final = true
+allow-picked-versions = false
+
+[common]
+extra-paths =
+ ${buildout:directory}/etc
+ ${buildout:directory}/src
+ ${buildout:directory}
+test-eggs =
+ coverage
+ fixtures
+ mock
+ nose
+ nose-subunit
+ postgresfixture
+ python-subunit
+ rabbitfixture
+ saucelabsfixture
+ sst
+ testresources
+ testscenarios
+ testtools
+initialization =
+ from os import environ
+ environ.setdefault("MAAS_CONFIG_DIR", "${buildout:directory}/etc/maas")
+
+[database]
+recipe = z3c.recipe.scripts
+eggs = postgresfixture
+extra-paths = ${common:extra-paths}
+interpreter =
+entry-points = database=postgresfixture.main:main
+scripts = database
+
+[maas]
+recipe = zc.recipe.egg
+# avahi and dbus should be listed as eggs
+# but they don't have links on PyPI and that makes buildout really
+# unhappy. It refuses to see them, even if they are in site-packages :-(
+# We rely on them being installed through system packages instead.
+dev-eggs =
+ django-debug-toolbar
+test-eggs =
+ ${common:test-eggs}
+ django-nose
+eggs =
+ ${maas:dev-eggs}
+ ${maas:test-eggs}
+ djorm-ext-pgarray
+ docutils
+entry-points =
+ maas=django.core.management:execute_from_command_line
+initialization =
+ ${common:initialization}
+ environ.setdefault("DJANGO_SETTINGS_MODULE", "maas.development")
+scripts = maas
+extra-paths =
+ ${common:extra-paths}
+
+[maas-test]
+recipe = zc.recipe.egg
+eggs =
+ ${maas:eggs}
+entry-points =
+ test.maas=django.core.management:execute_from_command_line
+initialization =
+ ${maas:initialization}
+ sys.argv[1:1] = [
+ "test", "--noinput", "--exclude=provisioningserver",
+ "--exclude=maastesting", "--exclude=maascli"]
+scripts = test.maas
+extra-paths =
+ ${maas:extra-paths}
+
+[maascli]
+recipe = zc.recipe.egg
+eggs =
+entry-points =
+ maascli=maascli:main
+extra-paths =
+ ${common:extra-paths}
+scripts =
+ maascli
+
+[maascli-test]
+recipe = zc.recipe.egg
+eggs =
+ ${maascli:eggs}
+ ${common:test-eggs}
+entry-points =
+ test.maascli=nose.core:TestProgram
+initialization =
+ sys.argv[1:1] = ["--where=src/maascli"]
+extra-paths = ${maascli:extra-paths}
+scripts =
+ test.maascli
+
+[maastesting-test]
+recipe = zc.recipe.egg
+eggs =
+ ${common:test-eggs}
+entry-points =
+ test.maastesting=nose.core:TestProgram
+initialization =
+ sys.argv[1:1] = ["--where=src/maastesting"]
+extra-paths = ${common:extra-paths}
+scripts =
+ test.maastesting
+scripts = test.maastesting
+extra-paths =
+ ${maas:extra-paths}
+
+[pserv]
+recipe = zc.recipe.egg
+eggs =
+entry-points =
+ celeryd=celery.bin.celeryd:main
+ maas-provision=provisioningserver.__main__:main
+ twistd.pserv=twisted.scripts.twistd:run
+extra-paths =
+ ${common:extra-paths}
+ contrib/python-tx-tftp
+scripts =
+ celeryd
+ maas-provision
+ twistd.pserv
+initialization =
+ ${common:initialization}
+
+[pserv-test]
+recipe = zc.recipe.egg
+eggs =
+ ${pserv:eggs}
+ ${common:test-eggs}
+entry-points =
+ test.pserv=nose.core:TestProgram
+initialization =
+ ${pserv:initialization}
+ sys.argv[1:1] = ["--where=src/provisioningserver"]
+extra-paths = ${pserv:extra-paths}
+scripts =
+ test.pserv
+
+[flake8]
+recipe = zc.recipe.egg
+eggs =
+ flake8
+entry-points =
+ flake8=flake8.run:main
+
+[sphinx]
+recipe = collective.recipe.sphinxbuilder
+source = ${buildout:directory}/docs
+build = ${buildout:directory}/docs/_build
+extra-paths = ${common:extra-paths}
+eggs =
+ ${maas:eggs}
+ ${pserv:eggs}
+
+# Convenient REPLs with all eggs available.
+[repl]
+recipe = z3c.recipe.scripts
+eggs =
+ ${maas:eggs}
+ ${pserv:eggs}
+ ${common:test-eggs}
+extra-paths = ${common:extra-paths}
+interpreter = py
+scripts = ipy
+entry-points =
+ ipy=IPython.frontend.terminal.ipapp:launch_new_instance
+
+[txlongpoll]
+recipe = z3c.recipe.scripts
+eggs =
+extra-paths = /buildout/creates/an/invalid/list/literal/without/this
+entry-points = twistd.txlongpoll=twisted.scripts.twistd:run
+scripts = twistd.txlongpoll
=== added directory 'contrib'
=== added file 'contrib/maas-cluster-http.conf'
--- contrib/maas-cluster-http.conf 1970-01-01 00:00:00 +0000
+++ contrib/maas-cluster-http.conf 2013-10-09 20:38:29 +0000
@@ -0,0 +1,9 @@
+# Server static files for tftp images as FPI
+# installer needs them
+Alias /MAAS/static/images/ /var/lib/maas/tftp/
+<Directory /var/lib/maas/tftp/>
+ <IfVersion >= 2.4>
+ Require all granted
+ </IfVersion>
+ SetHandler None
+</Directory>
=== added file 'contrib/maas-http.conf'
--- contrib/maas-http.conf 1970-01-01 00:00:00 +0000
+++ contrib/maas-http.conf 2013-10-09 20:38:29 +0000
@@ -0,0 +1,58 @@
+WSGIDaemonProcess maas user=maas group=maas processes=2 threads=1 display-name=%{GROUP}
+
+# Without this, defining a tag as a malformed xpath expression will hang
+# the region controller.
+# See https://techknowhow.library.emory.edu/blogs/branker/2010/07/30/django-lxml-wsgi-and-python-sub-interpreter-magic
+WSGIApplicationGroup %{GLOBAL}
+
+WSGIScriptAlias /MAAS /usr/share/maas/wsgi.py
+# Preload application when process starts. This will allow publishing
+# the MAAS server existence over Avahi.
+WSGIImportScript /usr/share/maas/wsgi.py process-group=maas application-group=maas
+WSGIPassAuthorization On
+
+<Directory /usr/share/maas/>
+ WSGIProcessGroup maas
+</Directory>
+
+<IfModule mod_ssl.c>
+ <VirtualHost *:443>
+ SSLEngine On
+ # Do not rely on these certificates, generate your own.
+ SSLCertificateFile /etc/ssl/certs/ssl-cert-snakeoil.pem
+ SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key
+ </VirtualHost>
+</IfModule>
+
+
+<IfModule mod_expires.c>
+ <Location /MAAS>
+ ExpiresActive On
+ ExpiresByType text/javascript "access plus 1 years"
+ ExpiresByType application/javascript "access plus 1 years"
+ ExpiresByType application/x-javascript "access plus 1 years"
+ ExpiresByType text/css "access plus 1 years"
+ ExpiresByType image/gif "access plus 1 years"
+ ExpiresByType image/jpeg "access plus 1 years"
+ ExpiresByType image/png "access plus 1 years"
+ </Location>
+</IfModule>
+
+# Proxy to txlongpoll server.
+<IfModule mod_proxy.c>
+ ProxyPreserveHost on
+ ProxyPass /MAAS/longpoll/ http://localhost:5242/ retry=1
+</IfModule>
+
+# This can be safely removed once Django 1.4 is used: admin media
+# will be served using staticfiles.
+Alias /MAAS/static/admin/ /usr/share/pyshared/django/contrib/admin/media/
+<Directory /usr/share/pyshared/django/contrib/admin/media/>
+ SetHandler None
+</Directory>
+
+# Serve files from staticfiles.
+Alias /MAAS/static/ /usr/share/maas/web/static/
+<Directory /usr/share/maas/web/static/>
+ SetHandler None
+</Directory>
=== added file 'contrib/maas_local_celeryconfig.py'
--- contrib/maas_local_celeryconfig.py 1970-01-01 00:00:00 +0000
+++ contrib/maas_local_celeryconfig.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,3 @@
+# Broker connection information.
+# Format: transport://userid:password@hostname:port/virtual_host
+BROKER_URL = ''
=== added file 'contrib/maas_local_celeryconfig_cluster.py'
--- contrib/maas_local_celeryconfig_cluster.py 1970-01-01 00:00:00 +0000
+++ contrib/maas_local_celeryconfig_cluster.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,2 @@
+# UUID identifying the running cluster controller.
+CLUSTER_UUID = None
=== added file 'contrib/maas_local_settings.py'
--- contrib/maas_local_settings.py 1970-01-01 00:00:00 +0000
+++ contrib/maas_local_settings.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,80 @@
+# Debug/Production mode.
+DEBUG = False
+
+# Default URL specifying protocol, host, and (if necessary) port where
+# systems in this MAAS can find the MAAS server. Configuration can, and
+# probably should, override this.
+DEFAULT_MAAS_URL = "http://maas.internal.example.com/"
+
+# Absolute path to the directory static files should be collected to.
+STATIC_ROOT = '/var/lib/maas/static/'
+
+# Prefix to use for MAAS's urls.
+# If FORCE_SCRIPT_NAME is None (the default), all the urls will start with
+# '/'.
+FORCE_SCRIPT_NAME = '/MAAS'
+
+# Where to store the user uploaded files.
+MEDIA_ROOT = '/var/lib/maas/media/'
+
+# Use the (libjs-yui) package's files to serve YUI3.
+YUI_LOCATION = '/usr/share/javascript/yui3/'
+
+# Use the package's files to serve RaphaelJS.
+RAPHAELJS_LOCATION = '/usr/share/javascript/raphael/'
+
+# RabbitMQ settings.
+RABBITMQ_HOST = 'localhost'
+RABBITMQ_USERID = 'maas_longpoll'
+RABBITMQ_PASSWORD = ''
+RABBITMQ_VIRTUAL_HOST = '/maas_longpoll'
+
+# See http://docs.djangoproject.com/en/dev/topics/logging for
+# more details on how to customize the logging configuration.
+LOGGING = {
+ 'version': 1,
+ 'disable_existing_loggers': False,
+ 'formatters': {
+ 'simple': {
+ 'format': '%(levelname)s %(asctime)s %(name)s %(message)s'
+ },
+ },
+ 'handlers': {
+ 'log': {
+ 'level': 'ERROR',
+ 'class': 'logging.handlers.RotatingFileHandler',
+ 'filename': '/var/log/maas/maas.log',
+ 'formatter': 'simple',
+ },
+ },
+ 'loggers': {
+ 'maasserver': {
+ 'handlers': ['log'],
+ 'propagate': True,
+ },
+ 'metadataserver': {
+ 'handlers': ['log'],
+ 'propagate': True,
+ },
+ 'django.request': {
+ 'handlers': ['log'],
+ 'propagate': True,
+ },
+ 'django.db.backends': {
+ 'handlers': ['log'],
+ 'propagate': True,
+ },
+ }
+}
+
+# Database access configuration.
+DATABASES = {
+ 'default': {
+ # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' etc.
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': '',
+ 'USER': '',
+ 'PASSWORD': '',
+ 'HOST': 'localhost',
+ }
+}
=== added directory 'contrib/preseeds_v2'
=== added file 'contrib/preseeds_v2/commissioning'
--- contrib/preseeds_v2/commissioning 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/commissioning 2013-10-09 20:38:29 +0000
@@ -0,0 +1,1 @@
+{{preseed_data}}
=== added file 'contrib/preseeds_v2/curtin'
--- contrib/preseeds_v2/curtin 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/curtin 2013-10-09 20:38:29 +0000
@@ -0,0 +1,1 @@
+{{preseed_data}}
=== added file 'contrib/preseeds_v2/curtin_userdata'
--- contrib/preseeds_v2/curtin_userdata 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/curtin_userdata 2013-10-09 20:38:29 +0000
@@ -0,0 +1,23 @@
+#cloud-config
+debconf_selections:
+ maas: |
+ {{for line in str(curtin_preseed).splitlines()}}
+ {{line}}
+ {{endfor}}
+late_commands:
+ maas: [wget, '--no-proxy', '{{node_disable_pxe_url|escape.shell}}', '--post-data', '{{node_disable_pxe_data|escape.shell}}', '-O', '/dev/null']
+
+power_state:
+ mode: reboot
+
+{{if node.architecture in {'i386/generic', 'amd64/generic'} }}
+apt_mirror: http://{{main_archive_hostname}}/{{main_archive_directory}}
+{{else}}
+apt_mirror: http://{{ports_archive_hostname}}/{{ports_archive_directory}}
+{{endif}}
+
+{{if http_proxy }}
+apt_proxy: {{http_proxy}}
+{{else}}
+apt_proxy: http://{{server_host}}:8000/
+{{endif}}
=== added file 'contrib/preseeds_v2/enlist'
--- contrib/preseeds_v2/enlist 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/enlist 2013-10-09 20:38:29 +0000
@@ -0,0 +1,10 @@
+#cloud-config
+datasource:
+ MAAS:
+ timeout : 50
+ max_wait : 120
+ # there are no default values for metadata_url or oauth credentials
+ # If no credentials are present, non-authed attempts will be made.
+ metadata_url: {{metadata_enlist_url}}
+
+output: {all: '| tee -a /var/log/cloud-init-output.log'}
=== added file 'contrib/preseeds_v2/enlist_userdata'
--- contrib/preseeds_v2/enlist_userdata 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/enlist_userdata 2013-10-09 20:38:29 +0000
@@ -0,0 +1,150 @@
+#cloud-config
+
+{{if http_proxy}}
+apt_proxy: {{http_proxy}}
+{{elif server_host}}
+apt_proxy: http://{{server_host}}:8000/
+{{endif}}
+
+misc_bucket:
+ - &maas_enlist |
+ #### IPMI setup ######
+ # If IPMI network settings have been configured statically, you can
+ # make them DHCP. If 'true', the IPMI network source will be changed
+ # to DHCP.
+ IPMI_CHANGE_STATIC_TO_DHCP="false"
+
+ # In certain hardware, the parameters for the ipmi_si kernel module
+ # might need to be specified. If you wish to send parameters, uncomment
+ # the following line.
+ #IPMI_SI_PARAMS="type=kcs ports=0xca2"
+
+ TEMP_D=$(mktemp -d "${TMPDIR:-/tmp}/${0##*/}.XXXXXX")
+ IPMI_CONFIG_D="${TEMP_D}/ipmi.d"
+ BIN_D="${TEMP_D}/bin"
+ OUT_D="${TEMP_D}/out"
+ PATH="$BIN_D:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
+
+ mkdir -p "$BIN_D" "$OUT_D" "$IPMI_CONFIG_D"
+
+ load_modules() {
+ modprobe ipmi_msghandler
+ modprobe ipmi_devintf
+ modprobe ipmi_si ${IPMI_SI_PARAMS}
+ udevadm settle
+ }
+
+ add_bin() {
+ cat > "${BIN_D}/$1"
+ chmod "${2:-755}" "${BIN_D}/$1"
+ }
+ add_ipmi_config() {
+ cat > "${IPMI_CONFIG_D}/$1"
+ chmod "${2:-644}" "${IPMI_CONFIG_D}/$1"
+ }
+
+ add_ipmi_config "02-global-config.ipmi" <<"END_IPMI_CONFIG"
+ Section Lan_Channel
+ Volatile_Access_Mode Always_Available
+ Volatile_Enable_User_Level_Auth Yes
+ Volatile_Channel_Privilege_Limit Administrator
+ Non_Volatile_Access_Mode Always_Available
+ Non_Volatile_Enable_User_Level_Auth Yes
+ Non_Volatile_Channel_Privilege_Limit Administrator
+ EndSection
+ END_IPMI_CONFIG
+
+ add_bin "maas-ipmi-autodetect-tool" <<"END_MAAS_IPMI_AUTODETECT_TOOL"
+ {{for line in maas_ipmi_autodetect_tool_py.splitlines()}}
+ {{line}}
+ {{endfor}}
+ END_MAAS_IPMI_AUTODETECT_TOOL
+
+ add_bin "maas-ipmi-autodetect" <<"END_MAAS_IPMI_AUTODETECT"
+ {{for line in maas_ipmi_autodetect_py.splitlines()}}
+ {{line}}
+ {{endfor}}
+ END_MAAS_IPMI_AUTODETECT
+
+ add_bin "maas-moonshot-autodetect" <<"END_MAAS_MOONSHOT_AUTODETECT"
+ {{for line in maas_moonshot_autodetect_py.splitlines()}}
+ {{line}}
+ {{endfor}}
+ END_MAAS_MOONSHOT_AUTODETECT
+
+ # we could obtain the interface that booted from the kernel cmdline
+ # thanks to 'IPAPPEND' (http://www.syslinux.org/wiki/index.php/SYSLINUX)
+ url="{{server_url}}"
+ host=""
+ ip=$(ifconfig eth0 | awk '$1 == "inet" { sub("addr:","",$2); print $2; }') &&
+ [ -n "${ip}" ] && host=$(dig +short -x $ip) && host=${host%.}
+ # load ipmi modules
+ load_modules
+ pargs=""
+ if $IPMI_CHANGE_STATIC_TO_DHCP; then
+ pargs="--dhcp-if-static"
+ fi
+ power_type=$(maas-ipmi-autodetect-tool)
+ case "$power_type" in
+ ipmi)
+ power_params=$(maas-ipmi-autodetect --configdir "$IPMI_CONFIG_D" ${pargs} --commission-creds) &&
+ [ -n "${power_params}" ] && power_params=${power_params%.}
+ ;;
+ moonshot)
+ power_params=$(maas-moonshot-autodetect --commission-creds) &&
+ [ -n "${power_params}" ] && power_params=${power_params%.}
+ ;;
+ esac
+ # Try maas-enlist without power parameters on failure for older versions of
+ # maas-enlist without power parameter support
+ maas-enlist --serverurl "$url" ${host:+--hostname "${host}"} ${power_params:+--power-params "${power_params}" --power-type "${power_type}"}>/tmp/enlist.out ||\
+ maas-enlist --serverurl "$url" ${host:+--hostname "${host}"} >/tmp/enlist.out
+ if [ $? -eq 0 ]; then
+ msg="successfully enlisted to '$url'"
+ [ -n "$host" ] && msg="$msg with hostname '$host'" ||
+ msg="$msg without hostname"
+ echo
+ echo "=== $(date -R): $msg"
+ cat /tmp/enlist.out
+ echo =============================================
+ sleep 10
+ else
+ user="ubuntu"
+ pass="ubuntu"
+
+ echo "$user:$pass" | chpasswd
+ bfile="/tmp/block-poweroff"
+ { echo "#!/bin/sh"; echo "touch $bfile"; } > /etc/profile.d/A01-block.sh
+ chmod 755 /etc/profile.d/A01-block.sh
+ echo
+ echo =============================================
+ echo "failed to enlist system maas server '$host'"
+ echo "sleeping 60 seconds then poweroff"
+ echo
+ echo "login with '$user:$pass' to debug and disable poweroff"
+ echo
+ cat /tmp/enlist.out
+ echo =============================================
+ sleep 60
+ [ -e $bfile ] && exit 0
+ fi
+ - &write_poweroff_job |
+ cat >/etc/init/maas-poweroff.conf <<EOF
+ description "poweroff when maas task is done"
+ start on stopped cloud-final
+ console output
+ task
+ script
+ [ ! -e /tmp/block-poweroff ] || exit 0
+ poweroff
+ end script
+ EOF
+ # reload required due to lack of inotify in overlayfs (LP: #882147)
+ initctl reload-configuration
+
+
+packages: [ maas-enlist, freeipmi-tools, openipmi, ipmitool ]
+output: {all: '| tee -a /var/log/cloud-init-output.log'}
+runcmd:
+ - [ sh, -c, *maas_enlist ]
+ - [ sh, -c, *write_poweroff_job ]
=== added file 'contrib/preseeds_v2/generic'
--- contrib/preseeds_v2/generic 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/generic 2013-10-09 20:38:29 +0000
@@ -0,0 +1,33 @@
+{{inherit "preseed_master"}}
+
+{{def proxy}}
+d-i mirror/country string manual
+{{if node.architecture in {'i386/generic', 'amd64/generic'} }}
+d-i mirror/http/hostname string {{main_archive_hostname}}
+d-i mirror/http/directory string {{main_archive_directory}}
+{{else}}
+d-i mirror/http/hostname string {{ports_archive_hostname}}
+d-i mirror/http/directory string {{ports_archive_directory}}
+{{endif}}
+{{if http_proxy }}
+d-i mirror/http/proxy string {{http_proxy}}
+{{else}}
+d-i mirror/http/proxy string http://{{server_host}}:8000/
+{{endif}}
+{{enddef}}
+
+{{def client_packages}}
+d-i pkgsel/include string cloud-init openssh-server python-software-properties vim avahi-daemon server^
+{{enddef}}
+
+{{def preseed}}
+{{preseed_data}}
+{{enddef}}
+
+{{def post_scripts}}
+# Executes late command and disables PXE.
+d-i preseed/late_command string true && \
+ in-target sh -c 'f=$1; shift; echo $0 > $f && chmod 0440 $f $*' 'ubuntu ALL=(ALL) NOPASSWD: ALL' /etc/sudoers.d/maas && \
+ in-target wget --no-proxy "{{node_disable_pxe_url|escape.shell}}" --post-data "{{node_disable_pxe_data|escape.shell}}" -O /dev/null && \
+ true
+{{enddef}}
=== added file 'contrib/preseeds_v2/preseed_master'
--- contrib/preseeds_v2/preseed_master 1970-01-01 00:00:00 +0000
+++ contrib/preseeds_v2/preseed_master 2013-10-09 20:38:29 +0000
@@ -0,0 +1,92 @@
+# MAAS - Ubuntu Server Installation
+# * Minimal install
+# * Cloud-init for bare-metal
+# * Cloud-init preseed data
+
+# Locale
+d-i debian-installer/locale string en_US.UTF-8
+
+# No splash
+d-i debian-installer/splash boolean false
+
+# Keyboard layout
+d-i console-setup/ask_detect boolean false
+d-i console-setup/layoutcode string us
+d-i console-setup/variantcode string
+
+# Network configuration
+d-i netcfg/get_nameservers string
+d-i netcfg/get_ipaddress string
+d-i netcfg/get_netmask string 255.255.255.0
+d-i netcfg/get_gateway string
+d-i netcfg/confirm_static boolean true
+
+# Local clock (set to UTC and use ntp)
+d-i clock-setup/utc boolean true
+d-i clock-setup/ntp boolean true
+d-i clock-setup/ntp-server string ntp.ubuntu.com
+d-i time/zone string Etc/UTC
+
+# Partitioning
+d-i partman/early_command string debconf-set partman-auto/disk `list-devices disk | head -n1`
+d-i partman-iscsi/mainmenu string finish
+d-i partman-auto/method string regular
+d-i partman-lvm/device_remove_lvm boolean true
+d-i partman-lvm/confirm boolean true
+d-i partman-md/device_remove_md boolean true
+d-i partman/confirm_write_new_label boolean true
+d-i partman/choose_partition select Finish partitioning and write changes to disk
+d-i partman/confirm boolean true
+d-i partman/confirm_nooverwrite boolean true
+d-i partman/default_filesystem string ext4
+
+# Use server kernel
+d-i base-installer/kernel/image string linux-server
+
+# User Setup
+d-i passwd/root-login boolean false
+d-i passwd/make-user boolean true
+d-i passwd/user-fullname string ubuntu
+d-i passwd/username string ubuntu
+d-i passwd/user-password-crypted password !
+d-i passwd/user-uid string
+d-i user-setup/allow-password-weak boolean false
+d-i user-setup/encrypt-home boolean false
+d-i passwd/user-default-groups string adm cdrom dialout lpadmin plugdev sambashare
+
+# APT
+{{self.proxy}}
+
+# By default the installer requires that repositories be authenticated
+# using a known gpg key. This setting can be used to disable that
+# authentication. Warning: Insecure, not recommended.
+d-i debian-installer/allow_unauthenticated string false
+
+# Lang
+d-i pkgsel/language-packs multiselect en
+d-i pkgsel/update-policy select none
+d-i pkgsel/updatedb boolean true
+
+# Boot-loader
+d-i grub-installer/skip boolean false
+d-i lilo-installer/skip boolean false
+d-i grub-installer/only_debian boolean true
+d-i grub-installer/with_other_os boolean true
+d-i finish-install/keep-consoles boolean false
+d-i finish-install/reboot_in_progress note
+
+# Eject cdrom
+d-i cdrom-detect/eject boolean true
+
+# Do not halt/poweroff after install
+d-i debian-installer/exit/halt boolean false
+d-i debian-installer/exit/poweroff boolean false
+
+# maas client packages
+{{self.client_packages}}
+
+# maas preseed
+{{self.preseed}}
+
+# Post scripts.
+{{self.post_scripts}}
=== added directory 'contrib/python-tx-tftp'
=== added file 'contrib/python-tx-tftp/LICENSE'
--- contrib/python-tx-tftp/LICENSE 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/LICENSE 2013-10-09 20:38:29 +0000
@@ -0,0 +1,20 @@
+Copyright (c) 2010-2012 Mark Lvov
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=== added file 'contrib/python-tx-tftp/README.markdown'
--- contrib/python-tx-tftp/README.markdown 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/README.markdown 2013-10-09 20:38:29 +0000
@@ -0,0 +1,25 @@
+python-tx-tftp
+==
+A Twisted-based TFTP implementation
+
+##What's already there
+
+ - [RFC1350](http://tools.ietf.org/html/rfc1350) (base TFTP specification) support.
+ - Asynchronous backend support. It is not assumed, that filesystem access is
+ 'fast enough'. While current backends use synchronous reads/writes, the code does
+ not rely on this anywhere, so plugging in an asynchronous backend should not be
+ a problem.
+ - netascii transfer mode.
+ - [RFC2347](http://tools.ietf.org/html/rfc2347) (TFTP Option
+Extension) support. *blksize*
+([RFC2348](http://tools.ietf.org/html/rfc2348)), *timeout* and *tsize*
+([RFC2349](http://tools.ietf.org/html/rfc2349)) options are supported.
+ - An actual TFTP server.
+ - Plugin for twistd.
+ - Tests
+ - Docstrings
+
+##Plans
+ - Client-specific commandline interface.
+ - Code cleanup.
+ - Multicast support (possibly).
=== added directory 'contrib/python-tx-tftp/examples'
=== added file 'contrib/python-tx-tftp/examples/server.py'
--- contrib/python-tx-tftp/examples/server.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/examples/server.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,19 @@
+'''
+@author: shylent
+'''
+from tftp.backend import FilesystemSynchronousBackend
+from tftp.protocol import TFTP
+from twisted.internet import reactor
+from twisted.python import log
+import random
+import sys
+
+
+def main():
+ random.seed()
+ log.startLogging(sys.stdout)
+ reactor.listenUDP(1069, TFTP(FilesystemSynchronousBackend('output')))
+ reactor.run()
+
+if __name__ == '__main__':
+ main()
=== added directory 'contrib/python-tx-tftp/tftp'
=== added file 'contrib/python-tx-tftp/tftp/__init__.py'
=== added file 'contrib/python-tx-tftp/tftp/backend.py'
--- contrib/python-tx-tftp/tftp/backend.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/backend.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,292 @@
+'''
+@author: shylent
+'''
+from os import fstat
+from tftp.errors import Unsupported, FileExists, AccessViolation, FileNotFound
+from tftp.util import deferred
+from twisted.python.filepath import FilePath, InsecurePath
+import shutil
+import tempfile
+from zope import interface
+
+class IBackend(interface.Interface):
+ """An object, that manages interaction between the TFTP network protocol and
+ anything, where you can get files from or put files to (a filesystem).
+
+ """
+
+ def get_reader(file_name):
+ """Return an object, that provides L{IReader}, that was initialized with
+ the given L{file_name}.
+
+ @param file_name: file name, specified as part of a TFTP read request (RRQ)
+ @type file_name: C{str}
+
+ @raise Unsupported: if reading is not supported for this particular
+ backend instance
+
+ @raise AccessViolation: if the passed file_name is not acceptable for
+ security or access control reasons
+
+ @raise FileNotFound: if the file, that corresponds to the given C{file_name}
+ could not be found
+
+ @raise BackendError: for any other errors, that were encountered while
+ attempting to construct a reader
+
+ @return: a L{Deferred} that will fire with an L{IReader}
+
+ """
+
+ def get_writer(file_name):
+ """Return an object, that provides L{IWriter}, that was initialized with
+ the given L{file_name}.
+
+ @param file_name: file name, specified as part of a TFTP write request (WRQ)
+ @type file_name: C{str}
+
+ @raise Unsupported: if writing is not supported for this particular
+ backend instance
+
+ @raise AccessViolation: if the passed file_name is not acceptable for
+ security or access control reasons
+
+ @raise FileExists: if the file, that corresponds to the given C{file_name}
+ already exists and it is not desirable to overwrite it
+
+ @raise BackendError: for any other errors, that were encountered while
+ attempting to construct a writer
+
+ @return: a L{Deferred} that will fire with an L{IWriter}
+
+ """
+
+class IReader(interface.Interface):
+ """An object, that performs reads on request of the TFTP protocol"""
+
+ size = interface.Attribute(
+ "The size of the file to be read, or C{None} if it's not known.")
+
+ def read(size):
+ """Attempt to read C{size} number of bytes.
+
+ @note: If less, than C{size} bytes is returned, it is assumed, that there
+ is no more data to read and the TFTP transfer is terminated. This means, that
+ less, than C{size} bytes should be returned if and only if this read should
+ be the last read for this reader object.
+
+ @param size: a number of bytes to return to the protocol
+ @type size: C{int}
+
+ @return: data, that was read or a L{Deferred}, that will be fired with
+ the data, that was read.
+ @rtype: C{str} or L{Deferred}
+
+ """
+
+ def finish():
+ """Release the resources, that were acquired by this reader and make sure,
+ that no additional data will be returned.
+
+ """
+
+
+class IWriter(interface.Interface):
+ """An object, that performs writes on request of the TFTP protocol"""
+
+ def write(data):
+ """Attempt to write the data
+
+ @return: C{None} or a L{Deferred}, that will fire with C{None} (any errors,
+ that occured during the write will be available in an errback)
+ @rtype: C{NoneType} or L{Deferred}
+
+ """
+
+ def finish():
+ """Tell this writer, that there will be no more data and that the transfer
+ was successfully completed
+
+ """
+
+ def cancel():
+ """Tell this writer, that the transfer has ended unsuccessfully"""
+
+
+class FilesystemReader(object):
+ """A reader to go with L{FilesystemSynchronousBackend}.
+
+ @see: L{IReader}
+
+ @param file_path: a path to file, that we will read from
+ @type file_path: L{FilePath<twisted.python.filepath.FilePath>}
+
+ @raise FileNotFound: if the file does not exist
+
+ """
+
+ interface.implements(IReader)
+
+ def __init__(self, file_path):
+ self.file_path = file_path
+ try:
+ self.file_obj = self.file_path.open('r')
+ except IOError:
+ raise FileNotFound(self.file_path)
+ self.state = 'active'
+
+ @property
+ def size(self):
+ """
+ @see: L{IReader.size}
+
+ """
+ if self.file_obj.closed:
+ return None
+ else:
+ return fstat(self.file_obj.fileno()).st_size
+
+ def read(self, size):
+ """
+ @see: L{IReader.read}
+
+ @return: data, that was read
+ @rtype: C{str}
+
+ """
+ if self.state in ('eof', 'finished'):
+ return ''
+ data = self.file_obj.read(size)
+ if not data:
+ self.state = 'eof'
+ self.file_obj.close()
+ return data
+
+ def finish(self):
+ """
+ @see: L{IReader.finish}
+
+ """
+ if self.state not in ('eof', 'finished'):
+ self.file_obj.close()
+ self.state = 'finished'
+
+
+class FilesystemWriter(object):
+ """A writer to go with L{FilesystemSynchronousBackend}.
+
+ This particular implementation actually writes to a temporary file. If the
+ transfer is completed successfully, contens of the target file are replaced
+ with the contents of the temporary file and the temporary file is removed.
+ If L{cancel} is called, both files are discarded.
+
+ @see: L{IWriter}
+
+ @param file_path: a path to file, that will be created and written to
+ @type file_path: L{FilePath<twisted.python.filepath.FilePath>}
+
+ @raise FileExists: if the file already exists
+
+ """
+
+ interface.implements(IWriter)
+
+ def __init__(self, file_path):
+ if file_path.exists():
+ raise FileExists(file_path)
+ file_dir = file_path.parent()
+ if not file_dir.exists():
+ file_dir.makedirs()
+ self.file_path = file_path
+ self.destination_file = self.file_path.open('w')
+ self.temp_destination = tempfile.TemporaryFile()
+ self.state = 'active'
+
+ def write(self, data):
+ """
+ @see: L{IWriter.write}
+
+ """
+ self.temp_destination.write(data)
+
+ def finish(self):
+ """
+ @see: L{IWriter.finish}
+
+ """
+ if self.state not in ('finished', 'cancelled'):
+ self.temp_destination.seek(0)
+ shutil.copyfileobj(self.temp_destination, self.destination_file)
+ self.temp_destination.close()
+ self.destination_file.close()
+ self.state = 'finished'
+
+ def cancel(self):
+ """
+ @see: L{IWriter.cancel}
+
+ """
+ if self.state not in ('finished', 'cancelled'):
+ self.temp_destination.close()
+ self.destination_file.close()
+ self.file_path.remove()
+ self.state = 'cancelled'
+
+
+class FilesystemSynchronousBackend(object):
+ """A synchronous filesystem backend.
+
+ @see: L{IBackend}
+
+ @param base_path: the base filesystem path for this backend, any attempts to
+ read or write 'above' the specified path will be denied
+ @type base_path: C{str} or L{FilePath<twisted.python.filepath.FilePath>}
+
+ @param can_read: whether or not this backend should support reads
+ @type can_read: C{bool}
+
+ @param can_write: whether or not this backend should support writes
+ @type can_write: C{bool}
+
+ """
+
+ interface.implements(IBackend)
+
+ def __init__(self, base_path, can_read=True, can_write=True):
+ try:
+ self.base = FilePath(base_path.path)
+ except AttributeError:
+ self.base = FilePath(base_path)
+ self.can_read, self.can_write = can_read, can_write
+
+ @deferred
+ def get_reader(self, file_name):
+ """
+ @see: L{IBackend.get_reader}
+
+ @rtype: L{Deferred}, yielding a L{FilesystemReader}
+
+ """
+ if not self.can_read:
+ raise Unsupported("Reading not supported")
+ try:
+ target_path = self.base.descendant(file_name.split("/"))
+ except InsecurePath, e:
+ raise AccessViolation("Insecure path: %s" % e)
+ return FilesystemReader(target_path)
+
+ @deferred
+ def get_writer(self, file_name):
+ """
+ @see: L{IBackend.get_writer}
+
+ @rtype: L{Deferred}, yielding a L{FilesystemWriter}
+
+ """
+ if not self.can_write:
+ raise Unsupported("Writing not supported")
+ try:
+ target_path = self.base.descendant(file_name.split("/"))
+ except InsecurePath, e:
+ raise AccessViolation("Insecure path: %s" % e)
+ return FilesystemWriter(target_path)
=== added file 'contrib/python-tx-tftp/tftp/bootstrap.py'
--- contrib/python-tx-tftp/tftp/bootstrap.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/bootstrap.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,409 @@
+'''
+@author: shylent
+'''
+from tftp.datagram import (ACKDatagram, ERRORDatagram, ERR_TID_UNKNOWN,
+ TFTPDatagramFactory, split_opcode, OP_OACK, OP_ERROR, OACKDatagram, OP_ACK,
+ OP_DATA)
+from tftp.session import WriteSession, MAX_BLOCK_SIZE, ReadSession
+from tftp.util import SequentialCall
+from twisted.internet import reactor
+from twisted.internet.protocol import DatagramProtocol
+from twisted.python import log
+from twisted.python.util import OrderedDict
+
+class TFTPBootstrap(DatagramProtocol):
+ """Base class for TFTP Bootstrap classes, classes, that handle initial datagram
+ exchange (option negotiation, etc), before the actual transfer is started.
+
+ Why OrderedDict and not the regular one? As per
+ U{RFC2347<http://tools.ietf.org/html/rfc2347>}, the order of options is, indeed,
+ not important, but having them in an arbitrary order would complicate testing.
+
+ @cvar supported_options: lists options, that we know how to handle
+
+ @ivar session: A L{WriteSession} or L{ReadSession} object, that will handle
+ the actual tranfer, after the initial handshake and option negotiation is
+ complete
+ @type session: L{WriteSession} or L{ReadSession}
+
+ @ivar options: a mapping of options, that this protocol instance was
+ initialized with. If it is empty and we are the server, usual logic (that
+ doesn't involve OACK datagrams) is used.
+ Default: L{OrderedDict<twisted.python.util.OrderedDict>}.
+ @type options: L{OrderedDict<twisted.python.util.OrderedDict>}
+
+ @ivar resultant_options: stores the last options mapping value, that was passed
+ from the remote peer
+ @type resultant_options: L{OrderedDict<twisted.python.util.OrderedDict>}
+
+ @ivar remote: remote peer address
+ @type remote: C{(str, int)}
+
+ @ivar timeout_watchdog: an object, that is responsible for timing the protocol
+ out. If we are initiating the transfer, it is provided by the parent protocol
+
+ @ivar backend: L{IReader} or L{IWriter} provider, that is used for this transfer
+ @type backend: L{IReader} or L{IWriter} provider
+
+ """
+ supported_options = ('blksize', 'timeout', 'tsize')
+
+ def __init__(self, remote, backend, options=None, _clock=None):
+ if options is None:
+ self.options = OrderedDict()
+ else:
+ self.options = options
+ self.resultant_options = OrderedDict()
+ self.remote = remote
+ self.timeout_watchdog = None
+ self.backend = backend
+ if _clock is not None:
+ self._clock = _clock
+ else:
+ self._clock = reactor
+
+ def processOptions(self, options):
+ """Process options mapping, discarding malformed or unknown options.
+
+ @param options: options mapping to process
+ @type options: L{OrderedDict<twisted.python.util.OrderedDict>}
+
+ @return: a mapping of processed options. Invalid options are discarded.
+ Whether or not the values of options may be changed is decided on a per-
+ option basis, according to the standard
+ @rtype L{OrderedDict<twisted.python.util.OrderedDict>}
+
+ """
+ accepted_options = OrderedDict()
+ for name, val in options.iteritems():
+ norm_name = name.lower()
+ if norm_name in self.supported_options:
+ actual_value = getattr(self, 'option_' + norm_name)(val)
+ if actual_value is not None:
+ accepted_options[name] = actual_value
+ return accepted_options
+
+ def option_blksize(self, val):
+ """Process the block size option. Valid range is between 8 and 65464,
+ inclusive. If the value is more, than L{MAX_BLOCK_SIZE}, L{MAX_BLOCK_SIZE}
+ is returned instead.
+
+ @param val: value of the option
+ @type val: C{str}
+
+ @return: accepted option value or C{None}, if it is invalid
+ @rtype: C{str} or C{None}
+
+ """
+ try:
+ int_blksize = int(val)
+ except ValueError:
+ return None
+ if int_blksize < 8 or int_blksize > 65464:
+ return None
+ int_blksize = min((int_blksize, MAX_BLOCK_SIZE))
+ return str(int_blksize)
+
+ def option_timeout(self, val):
+ """Process timeout interval option
+ (U{RFC2349<http://tools.ietf.org/html/rfc2349>}). Valid range is between 1
+ and 255, inclusive.
+
+ @param val: value of the option
+ @type val: C{str}
+
+ @return: accepted option value or C{None}, if it is invalid
+ @rtype: C{str} or C{None}
+
+ """
+ try:
+ int_timeout = int(val)
+ except ValueError:
+ return None
+ if int_timeout < 1 or int_timeout > 255:
+ return None
+ return str(int_timeout)
+
+ def option_tsize(self, val):
+ """Process tsize interval option
+ (U{RFC2349<http://tools.ietf.org/html/rfc2349>}). Valid range is 0 and up.
+
+ @param val: value of the option
+ @type val: C{str}
+
+ @return: accepted option value or C{None}, if it is invalid
+ @rtype: C{str} or C{None}
+
+ """
+ try:
+ int_tsize = int(val)
+ except ValueError:
+ return None
+ if int_tsize < 0:
+ return None
+ return str(int_tsize)
+
+ def applyOptions(self, session, options):
+ """Apply given options mapping to the given L{WriteSession} or
+ L{ReadSession} object.
+
+ @param session: A session object to apply the options to
+ @type session: L{WriteSession} or L{ReadSession}
+
+ @param options: Options to apply to the session object
+ @type options: L{OrderedDict<twisted.python.util.OrderedDict>}
+
+ """
+ for opt_name, opt_val in options.iteritems():
+ if opt_name == 'blksize':
+ session.block_size = int(opt_val)
+ elif opt_name == 'timeout':
+ timeout = int(opt_val)
+ session.timeout = (timeout,) * 3
+ elif opt_name == 'tsize':
+ tsize = int(opt_val)
+ session.tsize = tsize
+
+ def datagramReceived(self, datagram, addr):
+ if self.remote[1] != addr[1]:
+ self.transport.write(ERRORDatagram.from_code(ERR_TID_UNKNOWN).to_wire())
+ return# Does not belong to this transfer
+ datagram = TFTPDatagramFactory(*split_opcode(datagram))
+ if datagram.opcode == OP_ERROR:
+ return self.tftp_ERROR(datagram)
+ return self._datagramReceived(datagram)
+
+ def tftp_ERROR(self, datagram):
+ """Handle the L{ERRORDatagram}.
+
+ @param datagram: An ERROR datagram
+ @type datagram: L{ERRORDatagram}
+
+ """
+ log.msg("Got error: %s" % datagram)
+ return self.cancel()
+
+ def cancel(self):
+ """Terminate this protocol instance. If the underlying
+ L{ReadSession}/L{WriteSession} is running, delegate the call to it.
+
+ """
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ if self.session.started:
+ self.session.cancel()
+ else:
+ self.backend.finish()
+ self.transport.stopListening()
+
+ def timedOut(self):
+ """This protocol instance has timed out during the initial handshake."""
+ log.msg("Timed during option negotiation process")
+ self.cancel()
+
+
+class LocalOriginWriteSession(TFTPBootstrap):
+ """Bootstraps a L{WriteSession}, that was initiated locally, - we've requested
+ a read from a remote server
+
+ """
+ def __init__(self, remote, writer, options=None, _clock=None):
+ TFTPBootstrap.__init__(self, remote, writer, options, _clock)
+ self.session = WriteSession(writer, self._clock)
+
+ def startProtocol(self):
+ """Connect the transport and start the L{timeout_watchdog}"""
+ self.transport.connect(*self.remote)
+ if self.timeout_watchdog is not None:
+ self.timeout_watchdog.start()
+
+ def tftp_OACK(self, datagram):
+ """Handle the OACK datagram
+
+ @param datagram: OACK datagram
+ @type datagram: L{OACKDatagram}
+
+ """
+ if not self.session.started:
+ self.resultant_options = self.processOptions(datagram.options)
+ if self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ return self.transport.write(ACKDatagram(0).to_wire())
+ else:
+ log.msg("Duplicate OACK received, send back ACK and ignore")
+ self.transport.write(ACKDatagram(0).to_wire())
+
+ def _datagramReceived(self, datagram):
+ if datagram.opcode == OP_OACK:
+ return self.tftp_OACK(datagram)
+ elif datagram.opcode == OP_DATA and datagram.blocknum == 1:
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ if not self.session.started:
+ self.applyOptions(self.session, self.resultant_options)
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ return self.session.datagramReceived(datagram)
+ elif self.session.started:
+ return self.session.datagramReceived(datagram)
+
+
+class RemoteOriginWriteSession(TFTPBootstrap):
+ """Bootstraps a L{WriteSession}, that was originated remotely, - we've
+ received a WRQ from a client.
+
+ """
+ timeout = (1, 3, 7)
+
+ def __init__(self, remote, writer, options=None, _clock=None):
+ TFTPBootstrap.__init__(self, remote, writer, options, _clock)
+ self.session = WriteSession(writer, self._clock)
+
+ def startProtocol(self):
+ """Connect the transport, respond with an initial ACK or OACK (depending on
+ if we were initialized with options or not).
+
+ """
+ self.transport.connect(*self.remote)
+ if self.options:
+ self.resultant_options = self.processOptions(self.options)
+ bytes = OACKDatagram(self.resultant_options).to_wire()
+ else:
+ bytes = ACKDatagram(0).to_wire()
+ self.timeout_watchdog = SequentialCall.run(
+ self.timeout[:-1],
+ callable=self.transport.write, callable_args=[bytes, ],
+ on_timeout=lambda: self._clock.callLater(self.timeout[-1], self.timedOut),
+ run_now=True,
+ _clock=self._clock
+ )
+
+ def _datagramReceived(self, datagram):
+ if datagram.opcode == OP_DATA and datagram.blocknum == 1:
+ if self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ if not self.session.started:
+ self.applyOptions(self.session, self.resultant_options)
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ return self.session.datagramReceived(datagram)
+ elif self.session.started:
+ return self.session.datagramReceived(datagram)
+
+
+class LocalOriginReadSession(TFTPBootstrap):
+ """Bootstraps a L{ReadSession}, that was originated locally, - we've requested
+ a write to a remote server.
+
+ """
+ def __init__(self, remote, reader, options=None, _clock=None):
+ TFTPBootstrap.__init__(self, remote, reader, options, _clock)
+ self.session = ReadSession(reader, self._clock)
+
+ def startProtocol(self):
+ """Connect the transport and start the L{timeout_watchdog}"""
+ self.transport.connect(*self.remote)
+ if self.timeout_watchdog is not None:
+ self.timeout_watchdog.start()
+
+ def _datagramReceived(self, datagram):
+ if datagram.opcode == OP_OACK:
+ return self.tftp_OACK(datagram)
+ elif (datagram.opcode == OP_ACK and datagram.blocknum == 0
+ and not self.session.started):
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ return self.session.nextBlock()
+ elif self.session.started:
+ return self.session.datagramReceived(datagram)
+
+ def tftp_OACK(self, datagram):
+ """Handle incoming OACK datagram, process and apply options and hand over
+ control to the underlying L{ReadSession}.
+
+ @param datagram: OACK datagram
+ @type datagram: L{OACKDatagram}
+
+ """
+ if not self.session.started:
+ self.resultant_options = self.processOptions(datagram.options)
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ self.applyOptions(self.session, self.resultant_options)
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ return self.session.nextBlock()
+ else:
+ log.msg("Duplicate OACK received, ignored")
+
+class RemoteOriginReadSession(TFTPBootstrap):
+ """Bootstraps a L{ReadSession}, that was started remotely, - we've received
+ a RRQ.
+
+ """
+ timeout = (1, 3, 7)
+
+ def __init__(self, remote, reader, options=None, _clock=None):
+ TFTPBootstrap.__init__(self, remote, reader, options, _clock)
+ self.session = ReadSession(reader, self._clock)
+
+ def option_tsize(self, val):
+ """Process tsize option.
+
+ If tsize is zero, get the size of the file to be read so that it can
+ be returned in the OACK datagram.
+
+ @see: L{TFTPBootstrap.option_tsize}
+
+ """
+ val = TFTPBootstrap.option_tsize(self, val)
+ if val == str(0):
+ val = self.session.reader.size
+ if val is not None:
+ val = str(val)
+ return val
+
+ def startProtocol(self):
+ """Start sending an OACK datagram if we were initialized with options
+ or start the L{ReadSession} immediately.
+
+ """
+ self.transport.connect(*self.remote)
+ if self.options:
+ self.resultant_options = self.processOptions(self.options)
+ bytes = OACKDatagram(self.resultant_options).to_wire()
+ self.timeout_watchdog = SequentialCall.run(
+ self.timeout[:-1],
+ callable=self.transport.write, callable_args=[bytes, ],
+ on_timeout=lambda: self._clock.callLater(self.timeout[-1], self.timedOut),
+ run_now=True,
+ _clock=self._clock
+ )
+ else:
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ return self.session.nextBlock()
+
+ def _datagramReceived(self, datagram):
+ if datagram.opcode == OP_ACK and datagram.blocknum == 0:
+ return self.tftp_ACK(datagram)
+ elif self.session.started:
+ return self.session.datagramReceived(datagram)
+
+ def tftp_ACK(self, datagram):
+ """Handle incoming ACK datagram. Hand over control to the underlying
+ L{ReadSession}.
+
+ @param datagram: ACK datagram
+ @type datagram: L{ACKDatagram}
+
+ """
+ if self.timeout_watchdog is not None:
+ self.timeout_watchdog.cancel()
+ if not self.session.started:
+ self.applyOptions(self.session, self.resultant_options)
+ self.session.transport = self.transport
+ self.session.startProtocol()
+ return self.session.nextBlock()
=== added file 'contrib/python-tx-tftp/tftp/datagram.py'
--- contrib/python-tx-tftp/tftp/datagram.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/datagram.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,396 @@
+'''
+@author: shylent
+'''
+from itertools import chain
+from tftp.errors import (WireProtocolError, InvalidOpcodeError,
+ PayloadDecodeError, InvalidErrorcodeError, OptionsDecodeError)
+from twisted.python.util import OrderedDict
+import struct
+
+OP_RRQ = 1
+OP_WRQ = 2
+OP_DATA = 3
+OP_ACK = 4
+OP_ERROR = 5
+OP_OACK = 6
+
+ERR_NOT_DEFINED = 0
+ERR_FILE_NOT_FOUND = 1
+ERR_ACCESS_VIOLATION = 2
+ERR_DISK_FULL = 3
+ERR_ILLEGAL_OP = 4
+ERR_TID_UNKNOWN = 5
+ERR_FILE_EXISTS = 6
+ERR_NO_SUCH_USER = 7
+
+errors = {
+ ERR_NOT_DEFINED : "",
+ ERR_FILE_NOT_FOUND : "File not found",
+ ERR_ACCESS_VIOLATION : "Access violation",
+ ERR_DISK_FULL : "Disk full or allocation exceeded",
+ ERR_ILLEGAL_OP : "Illegal TFTP operation",
+ ERR_TID_UNKNOWN : "Unknown transfer ID",
+ ERR_FILE_EXISTS : "File already exists",
+ ERR_NO_SUCH_USER : "No such user"
+
+}
+
+def split_opcode(datagram):
+ """Split the raw datagram into opcode and payload.
+
+ @param datagram: raw datagram
+ @type datagram: C{str}
+
+ @return: a 2-tuple, the first item is the opcode and the second item is the payload
+ @rtype: (C{int}, C{str})
+
+ @raise WireProtocolError: if the opcode cannot be extracted
+
+ """
+
+ try:
+ return struct.unpack("!H", datagram[:2])[0], datagram[2:]
+ except struct.error:
+ raise WireProtocolError("Failed to extract the opcode")
+
+
+class TFTPDatagram(object):
+ """Base class for datagrams
+
+ @cvar opcode: The opcode, corresponding to this datagram
+ @type opcode: C{int}
+
+ """
+
+ opcode = None
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return a datagram object
+
+ @param payload: Binary representation of the payload (without the opcode)
+ @type payload: C{str}
+
+ """
+ raise NotImplementedError("Subclasses must override this")
+
+ def to_wire(self):
+ """Return the wire representation of the datagram.
+
+ @rtype: C{str}
+
+ """
+ raise NotImplementedError("Subclasses must override this")
+
+
+class RQDatagram(TFTPDatagram):
+ """Base class for "RQ" (request) datagrams.
+
+ @ivar filename: File name, that corresponds to this request.
+ @type filename: C{str}
+
+ @ivar mode: Transfer mode. Valid values are C{netascii} and C{octet}.
+ Case-insensitive.
+ @type mode: C{str}
+
+ @ivar options: Any options, that were requested by the client (as per
+ U{RFC2374<http://tools.ietf.org/html/rfc2347>}
+ @type options: C{dict}
+
+ """
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return a RRQ/WRQ datagram object.
+
+ @return: datagram object
+ @rtype: L{RRQDatagram} or L{WRQDatagram}
+
+ @raise OptionsDecodeError: if we failed to decode the options, requested
+ by the client
+ @raise PayloadDecodeError: if there were not enough fields in the payload.
+ Fields are terminated by NUL.
+
+ """
+ parts = payload.split('\x00')
+ try:
+ filename, mode = parts.pop(0), parts.pop(0)
+ except IndexError:
+ raise PayloadDecodeError("Not enough fields in the payload")
+ if parts and not parts[-1]:
+ parts.pop(-1)
+ options = OrderedDict()
+ # To maintain consistency during testing.
+ # The actual order of options is not important as per RFC2347
+ if len(parts) % 2:
+ raise OptionsDecodeError("No value for option %s" % parts[-1])
+ for ind, opt_name in enumerate(parts[::2]):
+ if opt_name in options:
+ raise OptionsDecodeError("Duplicate option specified: %s" % opt_name)
+ options[opt_name] = parts[ind * 2 + 1]
+ return cls(filename, mode, options)
+
+ def __init__(self, filename, mode, options):
+ self.filename = filename
+ self.mode = mode.lower()
+ self.options = options
+
+ def __repr__(self):
+ if self.options:
+ return ("<%s(filename=%s, mode=%s, options=%s)>" %
+ (self.__class__.__name__, self.filename, self.mode, self.options))
+ return "<%s(filename=%s, mode=%s)>" % (self.__class__.__name__,
+ self.filename, self.mode)
+
+ def to_wire(self):
+ opcode = struct.pack("!H", self.opcode)
+ if self.options:
+ options = '\x00'.join(chain.from_iterable(self.options.iteritems()))
+ return ''.join((opcode, self.filename, '\x00', self.mode, '\x00',
+ options, '\x00'))
+ else:
+ return ''.join((opcode, self.filename, '\x00', self.mode, '\x00'))
+
+class RRQDatagram(RQDatagram):
+ opcode = OP_RRQ
+
+class WRQDatagram(RQDatagram):
+ opcode = OP_WRQ
+
+class OACKDatagram(TFTPDatagram):
+ """An OACK datagram
+
+ @ivar options: Any options, that were requested by the client (as per
+ U{RFC2374<http://tools.ietf.org/html/rfc2347>}
+ @type options: C{dict}
+
+ """
+ opcode = OP_OACK
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return an OACK datagram object.
+
+ @return: datagram object
+ @rtype: L{OACKDatagram}
+
+ @raise OptionsDecodeError: if we failed to decode the options
+
+ """
+ parts = payload.split('\x00')
+ #FIXME: Boo, code duplication
+ if parts and not parts[-1]:
+ parts.pop(-1)
+ options = OrderedDict()
+ if len(parts) % 2:
+ raise OptionsDecodeError("No value for option %s" % parts[-1])
+ for ind, opt_name in enumerate(parts[::2]):
+ if opt_name in options:
+ raise OptionsDecodeError("Duplicate option specified: %s" % opt_name)
+ options[opt_name] = parts[ind * 2 + 1]
+ return cls(options)
+
+ def __init__(self, options):
+ self.options = options
+
+ def __repr__(self):
+ return ("<%s(options=%s)>" % (self.__class__.__name__, self.options))
+
+ def to_wire(self):
+ opcode = struct.pack("!H", self.opcode)
+ if self.options:
+ options = '\x00'.join(chain.from_iterable(self.options.iteritems()))
+ return ''.join((opcode, options, '\x00'))
+ else:
+ return opcode
+
+class DATADatagram(TFTPDatagram):
+ """A DATA datagram
+
+ @ivar blocknum: A block number, that this chunk of data is associated with
+ @type blocknum: C{int}
+
+ @ivar data: binary data
+ @type data: C{str}
+
+ """
+ opcode = OP_DATA
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return a L{DATADatagram} object.
+
+ @param payload: Binary representation of the payload (without the opcode)
+ @type payload: C{str}
+
+ @return: A L{DATADatagram} object
+ @rtype: L{DATADatagram}
+
+ @raise PayloadDecodeError: if the format of payload is incorrect
+
+ """
+ try:
+ blocknum, data = struct.unpack('!H', payload[:2])[0], payload[2:]
+ except struct.error:
+ raise PayloadDecodeError()
+ return cls(blocknum, data)
+
+ def __init__(self, blocknum, data):
+ self.blocknum = blocknum
+ self.data = data
+
+ def __repr__(self):
+ return "<%s(blocknum=%s, %s bytes of data)>" % (self.__class__.__name__,
+ self.blocknum, len(self.data))
+
+ def to_wire(self):
+ return ''.join((struct.pack('!HH', self.opcode, self.blocknum), self.data))
+
+class ACKDatagram(TFTPDatagram):
+ """An ACK datagram.
+
+ @ivar blocknum: Block number of the data chunk, which this datagram is supposed to acknowledge
+ @type blocknum: C{int}
+
+ """
+ opcode = OP_ACK
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return a L{ACKDatagram} object.
+
+ @param payload: Binary representation of the payload (without the opcode)
+ @type payload: C{str}
+
+ @return: An L{ACKDatagram} object
+ @rtype: L{ACKDatagram}
+
+ @raise PayloadDecodeError: if the format of payload is incorrect
+
+ """
+ try:
+ blocknum = struct.unpack('!H', payload)[0]
+ except struct.error:
+ raise PayloadDecodeError("Unable to extract the block number")
+ return cls(blocknum)
+
+ def __init__(self, blocknum):
+ self.blocknum = blocknum
+
+ def __repr__(self):
+ return "<%s(blocknum=%s)>" % (self.__class__.__name__, self.blocknum)
+
+ def to_wire(self):
+ return struct.pack('!HH', self.opcode, self.blocknum)
+
+class ERRORDatagram(TFTPDatagram):
+ """An ERROR datagram.
+
+ @ivar errorcode: A valid TFTP error code
+ @type errorcode: C{int}
+
+ @ivar errmsg: An error message, describing the error condition in which this
+ datagram was produced
+ @type errmsg: C{str}
+
+ """
+ opcode = OP_ERROR
+
+ @classmethod
+ def from_wire(cls, payload):
+ """Parse the payload and return a L{ERRORDatagram} object.
+
+ This method violates the standard a bit - if the error string was not
+ extracted, a default error string is generated, based on the error code.
+
+ @param payload: Binary representation of the payload (without the opcode)
+ @type payload: C{str}
+
+ @return: An L{ERRORDatagram} object
+ @rtype: L{ERRORDatagram}
+
+ @raise PayloadDecodeError: if the format of payload is incorrect
+ @raise InvalidErrorcodeError: a more specific exception, that is raised
+ if the error code was successfully, extracted, but it does not correspond
+ to any known/standartized error code values.
+
+ """
+ try:
+ errorcode = struct.unpack('!H', payload[:2])[0]
+ except struct.error:
+ raise PayloadDecodeError("Unable to extract the error code")
+ if not errorcode in errors:
+ raise InvalidErrorcodeError(errorcode)
+ errmsg = payload[2:].split('\x00')[0]
+ if not errmsg:
+ errmsg = errors[errorcode]
+ return cls(errorcode, errmsg)
+
+ @classmethod
+ def from_code(cls, errorcode, errmsg=None):
+ """Create an L{ERRORDatagram}, given an error code and, optionally, an
+ error message to go with it. If not provided, default error message for
+ the given error code is used.
+
+ @param errorcode: An error code (one of L{errors})
+ @type errorcode: C{int}
+
+ @param errmsg: An error message (optional)
+ @type errmsg: C{str} or C{NoneType}
+
+ @raise InvalidErrorcodeError: if the error code is not known
+
+ @return: an L{ERRORDatagram}
+ @rtype: L{ERRORDatagram}
+
+ """
+ if not errorcode in errors:
+ raise InvalidErrorcodeError(errorcode)
+ if errmsg is None:
+ errmsg = errors[errorcode]
+ return cls(errorcode, errmsg)
+
+
+ def __init__(self, errorcode, errmsg):
+ self.errorcode = errorcode
+ self.errmsg = errmsg
+
+ def to_wire(self):
+ return ''.join((struct.pack('!HH', self.opcode, self.errorcode),
+ self.errmsg, '\x00'))
+
+class _TFTPDatagramFactory(object):
+ """Encapsulates the creation of datagrams based on the opcode"""
+ _dgram_classes = {
+ OP_RRQ: RRQDatagram,
+ OP_WRQ: WRQDatagram,
+ OP_DATA: DATADatagram,
+ OP_ACK: ACKDatagram,
+ OP_ERROR: ERRORDatagram,
+ OP_OACK: OACKDatagram
+ }
+
+ def __call__(self, opcode, payload):
+ """Create a datagram, given an opcode and payload.
+
+ Errors, that occur during datagram creation are propagated as-is.
+
+ @param opcode: opcode
+ @type opcode: C{int}
+
+ @param payload: payload
+ @type payload: C{str}
+
+ @return: datagram object
+ @rtype: L{TFTPDatagram}
+
+ @raise InvalidOpcodeError: if the opcode is not recognized
+
+ """
+ try:
+ datagram_class = self._dgram_classes[opcode]
+ except KeyError:
+ raise InvalidOpcodeError(opcode)
+ return datagram_class.from_wire(payload)
+
+TFTPDatagramFactory = _TFTPDatagramFactory()
=== added file 'contrib/python-tx-tftp/tftp/errors.py'
--- contrib/python-tx-tftp/tftp/errors.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/errors.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,86 @@
+'''
+@author: shylent
+'''
+
+class TFTPError(Exception):
+ """Base exception class for this package"""
+
+class WireProtocolError(TFTPError):
+ """Base exception class for wire-protocol level errors"""
+
+class InvalidOpcodeError(WireProtocolError):
+ """An invalid opcode was encountered"""
+
+ def __init__(self, opcode):
+
+ super(InvalidOpcodeError, self).__init__("Invalid opcode: %s" % opcode)
+
+class PayloadDecodeError(WireProtocolError):
+ """Failed to parse the payload"""
+
+class OptionsDecodeError(PayloadDecodeError):
+ """Failed to parse options in the WRQ/RRQ datagram. It is distinct from
+ L{PayloadDecodeError} so that it can be caught and dealt with gracefully
+ (pretend we didn't see any options at all, perhaps).
+
+ """
+
+class InvalidErrorcodeError(PayloadDecodeError):
+ """An ERROR datagram has an error code, that does not correspond to any known
+ error code values.
+
+ @ivar errorcode: The error code, that we were unable to parse
+ @type errorcode: C{int}
+
+ """
+
+ def __init__(self, errorcode):
+ self.errorcode = errorcode
+ super(InvalidErrorcodeError, self).__init__("Unknown error code: %s" % errorcode)
+
+class BackendError(TFTPError):
+ """Base exception class for backend errors"""
+
+class Unsupported(BackendError):
+ """Requested operation (read/write) is not supported"""
+
+class AccessViolation(BackendError):
+ """Illegal filesystem operation. Corresponds to the "(2) Access violation"
+ TFTP error code.
+
+ One of the prime examples of these is an attempt at directory traversal.
+
+ """
+
+class FileNotFound(BackendError):
+ """File not found.
+
+ Corresponds to the "(1) File not found" TFTP error code.
+
+ @ivar file_path: Path to the file, that was requested
+ @type file_path: C{str} or L{twisted.python.filepath.FilePath}
+
+ """
+
+ def __init__(self, file_path):
+ self.file_path = file_path
+
+ def __str__(self):
+ return "File not found: %s" % self.file_path
+
+
+class FileExists(BackendError):
+ """File exists.
+
+ Corresponds to the "(6) File already exists" TFTP error code.
+
+ @ivar file_path: Path to file
+ @type file_path: C{str} or L{twisted.python.filepath.FilePath}
+
+ """
+
+ def __init__(self, file_path):
+ self.file_path = file_path
+
+ def __str__(self):
+ return "File already exists: %s" % self.file_path
=== added file 'contrib/python-tx-tftp/tftp/netascii.py'
--- contrib/python-tx-tftp/tftp/netascii.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/netascii.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,136 @@
+'''
+@author: shylent
+'''
+# So basically, the idea is that in netascii a *newline* (whatever that is
+# on the current platform) is represented by a CR+LF sequence and a single CR
+# is represented by CR+NUL.
+
+from twisted.internet.defer import maybeDeferred, succeed
+import os
+import re
+
+__all__ = ['NetasciiSenderProxy', 'NetasciiReceiverProxy',
+ 'to_netascii', 'from_netascii']
+
+CR = '\x0d'
+LF = '\x0a'
+CRLF = CR + LF
+NUL = '\x00'
+CRNUL = CR + NUL
+
+NL = os.linesep
+
+
+re_from_netascii = re.compile('(\x0d\x0a|\x0d\x00)')
+
+def _convert_from_netascii(match_obj):
+ if match_obj.group(0) == CRLF:
+ return NL
+ elif match_obj.group(0) == CRNUL:
+ return CR
+
+def from_netascii(data):
+ """Convert a netascii-encoded string into a string with platform-specific
+ newlines.
+
+ """
+ return re_from_netascii.sub(_convert_from_netascii, data)
+
+# So that I can easily switch the NL around in tests
+_re_to_netascii = '(%s|\x0d)'
+re_to_netascii = re.compile(_re_to_netascii % NL)
+
+def _convert_to_netascii(match_obj):
+ if match_obj.group(0) == NL:
+ return CRLF
+ elif match_obj.group(0) == CR:
+ return CRNUL
+
+def to_netascii(data):
+ """Convert a string with platform-specific newlines into netascii."""
+ return re_to_netascii.sub(_convert_to_netascii, data)
+
+class NetasciiReceiverProxy(object):
+ """Proxies an object, that provides L{IWriter}. Incoming data is transformed
+ as follows:
+ - CR+LF is replaced with the platform-specific newline
+ - CR+NUL is replaced with CR
+
+ @param writer: an L{IWriter} object, that will be used to perform the actual writes
+ @type writer: L{IWriter} provider
+
+ """
+
+ def __init__(self, writer):
+ self.writer = writer
+ self._carry_cr = False
+
+ def write(self, data):
+ """Attempt a write, performing transformation as described in
+ L{NetasciiReceiverProxy}. May write 1 byte less, than provided, if the last
+ byte in the chunk is a CR.
+
+ @param data: data to be written
+ @type data: C{str}
+
+ @return: L{Deferred}, that will be fired when the write is complete
+ @rtype: L{Deferred}
+
+ """
+ if self._carry_cr:
+ data = CR + data
+ data = from_netascii(data)
+ if data.endswith(CR):
+ self._carry_cr = True
+ return maybeDeferred(self.writer.write, data[:-1])
+ else:
+ self._carry_cr = False
+ return maybeDeferred(self.writer.write, data)
+
+ def __getattr__(self, name):
+ return getattr(self.writer, name)
+
+
+class NetasciiSenderProxy(object):
+ """Proxies an object, that provides L{IReader}. The data that is read is
+ transformed as follows:
+ - platform-specific newlines are replaced with CR+LF
+ - freestanding CR are replaced with CR+NUL
+
+ @param reader: an L{IReader} object
+ @type reader: L{IReader} provider
+
+ """
+
+ def __init__(self, reader):
+ self.reader = reader
+ self.buffer = ''
+
+ def read(self, size):
+ """Attempt to read C{size} bytes, transforming them as described in
+ L{NetasciiSenderProxy}.
+
+ @param size: number of bytes to read
+ @type size: C{int}
+
+ @return: L{Deferred}, that will be fired with exactly C{size} bytes,
+ regardless of the transformation, that was performed if there is more data,
+ or less, than C{size} bytes if there is no more data to read.
+ @rtype: L{Deferred}
+
+ """
+ need_bytes = size - len(self.buffer)
+ if need_bytes <= 0:
+ data, self.buffer = self.buffer[:size], self.buffer[size:]
+ return succeed(data)
+ d = maybeDeferred(self.reader.read, need_bytes)
+ d.addCallback(self._gotDataFromReader, size)
+ return d
+
+ def _gotDataFromReader(self, data, size):
+ data = self.buffer + to_netascii(data)
+ data, self.buffer = data[:size], data[size:]
+ return data
+
+ def __getattr__(self, name):
+ return getattr(self.reader, name)
=== added file 'contrib/python-tx-tftp/tftp/protocol.py'
--- contrib/python-tx-tftp/tftp/protocol.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/protocol.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,93 @@
+'''
+@author: shylent
+'''
+from tftp.bootstrap import RemoteOriginWriteSession, RemoteOriginReadSession
+from tftp.datagram import (TFTPDatagramFactory, split_opcode, OP_WRQ,
+ ERRORDatagram, ERR_NOT_DEFINED, ERR_ACCESS_VIOLATION, ERR_FILE_EXISTS,
+ ERR_ILLEGAL_OP, OP_RRQ, ERR_FILE_NOT_FOUND)
+from tftp.errors import (FileExists, Unsupported, AccessViolation, BackendError,
+ FileNotFound)
+from tftp.netascii import NetasciiReceiverProxy, NetasciiSenderProxy
+from twisted.internet import reactor
+from twisted.internet.defer import inlineCallbacks, returnValue
+from twisted.internet.protocol import DatagramProtocol
+from twisted.python import log
+from twisted.python.context import call
+
+
+class TFTP(DatagramProtocol):
+ """TFTP dispatch protocol. Handles read requests (RRQ) and write requests (WRQ)
+ and starts the corresponding sessions.
+
+ @ivar backend: an L{IBackend} provider, that will handle interaction with
+ local resources
+ @type backend: L{IBackend} provider
+
+ """
+ def __init__(self, backend, _clock=None):
+ self.backend = backend
+ if _clock is None:
+ self._clock = reactor
+ else:
+ self._clock = _clock
+
+ def startProtocol(self):
+ addr = self.transport.getHost()
+ log.msg("TFTP Listener started at %s:%s" % (addr.host, addr.port))
+
+ def datagramReceived(self, datagram, addr):
+ datagram = TFTPDatagramFactory(*split_opcode(datagram))
+ log.msg("Datagram received from %s: %s" % (addr, datagram))
+
+ mode = datagram.mode.lower()
+ if datagram.mode not in ('netascii', 'octet'):
+ return self.transport.write(ERRORDatagram.from_code(ERR_ILLEGAL_OP,
+ "Unknown transfer mode %s, - expected "
+ "'netascii' or 'octet' (case-insensitive)" % mode).to_wire(), addr)
+
+ self._clock.callLater(0, self._startSession, datagram, addr, mode)
+
+ @inlineCallbacks
+ def _startSession(self, datagram, addr, mode):
+ # Set up a call context so that we can pass extra arbitrary
+ # information to interested backends without adding extra call
+ # arguments, or switching to using a request object, for example.
+ context = {}
+ if self.transport is not None:
+ # Add the local and remote addresses to the call context.
+ local = self.transport.getHost()
+ context["local"] = local.host, local.port
+ context["remote"] = addr
+ try:
+ if datagram.opcode == OP_WRQ:
+ fs_interface = yield call(
+ context, self.backend.get_writer, datagram.filename)
+ elif datagram.opcode == OP_RRQ:
+ fs_interface = yield call(
+ context, self.backend.get_reader, datagram.filename)
+ except Unsupported, e:
+ self.transport.write(ERRORDatagram.from_code(ERR_ILLEGAL_OP,
+ str(e)).to_wire(), addr)
+ except AccessViolation:
+ self.transport.write(ERRORDatagram.from_code(ERR_ACCESS_VIOLATION).to_wire(), addr)
+ except FileExists:
+ self.transport.write(ERRORDatagram.from_code(ERR_FILE_EXISTS).to_wire(), addr)
+ except FileNotFound:
+ self.transport.write(ERRORDatagram.from_code(ERR_FILE_NOT_FOUND).to_wire(), addr)
+ except BackendError, e:
+ self.transport.write(ERRORDatagram.from_code(ERR_NOT_DEFINED, str(e)).to_wire(), addr)
+ else:
+ if datagram.opcode == OP_WRQ:
+ if mode == 'netascii':
+ fs_interface = NetasciiReceiverProxy(fs_interface)
+ session = RemoteOriginWriteSession(addr, fs_interface,
+ datagram.options, _clock=self._clock)
+ reactor.listenUDP(0, session)
+ returnValue(session)
+ elif datagram.opcode == OP_RRQ:
+ if mode == 'netascii':
+ fs_interface = NetasciiSenderProxy(fs_interface)
+ session = RemoteOriginReadSession(addr, fs_interface,
+ datagram.options, _clock=self._clock)
+ reactor.listenUDP(0, session)
+ returnValue(session)
=== added file 'contrib/python-tx-tftp/tftp/session.py'
--- contrib/python-tx-tftp/tftp/session.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/session.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,280 @@
+'''
+@author: shylent
+'''
+from tftp.datagram import (ACKDatagram, ERRORDatagram, OP_DATA, OP_ERROR, ERR_ILLEGAL_OP,
+ ERR_DISK_FULL, OP_ACK, DATADatagram, ERR_NOT_DEFINED,)
+from tftp.util import SequentialCall
+from twisted.internet import reactor
+from twisted.internet.defer import maybeDeferred
+from twisted.internet.protocol import DatagramProtocol
+from twisted.python import log
+
+MAX_BLOCK_SIZE = 1400
+
+
+class WriteSession(DatagramProtocol):
+ """Represents a transfer, during which we write to a local file. If we are a
+ server, this means, that we received a WRQ (write request). If we are a client,
+ this means, that we have requested a read from a remote server.
+
+ @cvar block_size: Expected block size. If a data chunk is received and its length
+ is less, than C{block_size}, it is assumed that that data chunk is the last in the
+ transfer. Default: 512 (as per U{RFC1350<http://tools.ietf.org/html/rfc1350>})
+ @type block_size: C{int}.
+
+ @cvar timeout: An iterable, that yields timeout values for every subsequent
+ ACKDatagram, that we've sent, that is not followed by the next data chunk.
+ When (if) the iterable is exhausted, the transfer is considered failed.
+ @type timeout: any iterable
+
+ @ivar started: whether or not this protocol has started
+ @type started: C{bool}
+
+ """
+
+ block_size = 512
+ timeout = (1, 3, 7)
+ tsize = None
+
+ def __init__(self, writer, _clock=None):
+ self.writer = writer
+ self.blocknum = 0
+ self.completed = False
+ self.started = False
+ self.timeout_watchdog = None
+ if _clock is None:
+ self._clock = reactor
+ else:
+ self._clock = _clock
+
+ def cancel(self):
+ """Cancel this session, discard any data, that was collected
+ and give up the connector.
+
+ """
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ self.writer.cancel()
+ self.transport.stopListening()
+
+ def startProtocol(self):
+ self.started = True
+
+ def connectionRefused(self):
+ if not self.completed:
+ self.writer.cancel()
+ self.transport.stopListening()
+
+ def datagramReceived(self, datagram):
+ if datagram.opcode == OP_DATA:
+ return self.tftp_DATA(datagram)
+ elif datagram.opcode == OP_ERROR:
+ log.msg("Got error: %s" % datagram)
+ self.cancel()
+
+ def tftp_DATA(self, datagram):
+ """Handle incoming DATA TFTP datagram
+
+ @type datagram: L{DATADatagram}
+
+ """
+ next_blocknum = self.blocknum + 1
+ if datagram.blocknum < next_blocknum:
+ self.transport.write(ACKDatagram(datagram.blocknum).to_wire())
+ elif datagram.blocknum == next_blocknum:
+ if self.completed:
+ self.transport.write(ERRORDatagram.from_code(
+ ERR_ILLEGAL_OP, "Transfer already finished").to_wire())
+ else:
+ return self.nextBlock(datagram)
+ else:
+ self.transport.write(ERRORDatagram.from_code(
+ ERR_ILLEGAL_OP, "Block number mismatch").to_wire())
+
+ def nextBlock(self, datagram):
+ """Handle fresh data, attempt to write it to backend
+
+ @type datagram: L{DATADatagram}
+
+ """
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ self.blocknum += 1
+ d = maybeDeferred(self.writer.write, datagram.data)
+ d.addCallbacks(callback=self.blockWriteSuccess, callbackArgs=[datagram, ],
+ errback=self.blockWriteFailure)
+ return d
+
+ def blockWriteSuccess(self, ign, datagram):
+ """The write was successful, respond with ACK for current block number
+
+ If this is the last chunk (received data length < block size), the protocol
+ will keep running until the end of current timeout period, so we can respond
+ to any duplicates.
+
+ @type datagram: L{DATADatagram}
+
+ """
+ bytes = ACKDatagram(datagram.blocknum).to_wire()
+ self.timeout_watchdog = SequentialCall.run(self.timeout[:-1],
+ callable=self.sendData, callable_args=[bytes, ],
+ on_timeout=lambda: self._clock.callLater(self.timeout[-1], self.timedOut),
+ run_now=True,
+ _clock=self._clock
+ )
+ if len(datagram.data) < self.block_size:
+ self.completed = True
+ self.writer.finish()
+ # TODO: If self.tsize is not None, compare it with the actual
+ # count of bytes written. Log if there's a mismatch. Should it
+ # also emit an error datagram?
+
+ def blockWriteFailure(self, failure):
+ """Write failed"""
+ log.err(failure)
+ self.transport.write(ERRORDatagram.from_code(ERR_DISK_FULL).to_wire())
+ self.cancel()
+
+ def timedOut(self):
+ """Called when the protocol has timed out. Let the backend know, if the
+ the transfer was successful.
+
+ """
+ if not self.completed:
+ log.msg("Timed out while waiting for next block")
+ self.writer.cancel()
+ else:
+ log.msg("Timed out after a successful transfer")
+ self.transport.stopListening()
+
+ def sendData(self, bytes):
+ """Send data to the remote peer
+
+ @param bytes: bytes to send
+ @type bytes: C{str}
+
+ """
+ self.transport.write(bytes)
+
+
+class ReadSession(DatagramProtocol):
+ """Represents a transfer, during which we read from a local file
+ (and write to the network). If we are a server, this means, that we've received
+ a RRQ (read request). If we are a client, this means that we've requested to
+ write to a remote server.
+
+ @cvar block_size: The data will be sent in chunks of this size. If we send
+ a chunk with the size < C{block_size}, the transfer will end.
+ Default: 512 (as per U{RFC1350<http://tools.ietf.org/html/rfc1350>})
+ @type block_size: C{int}
+
+ @cvar timeout: An iterable, that yields timeout values for every subsequent
+ unacknowledged DATADatagram, that we've sent. When (if) the iterable is exhausted,
+ the transfer is considered failed.
+ @type timeout: any iterable
+
+ @ivar started: whether or not this protocol has started
+ @type started: C{bool}
+
+ """
+ block_size = 512
+ timeout = (1, 3, 7)
+
+ def __init__(self, reader, _clock=None):
+ self.reader = reader
+ self.blocknum = 0
+ self.started = False
+ self.completed = False
+ self.timeout_watchdog = None
+ if _clock is None:
+ self._clock = reactor
+ else:
+ self._clock = _clock
+
+ def cancel(self):
+ """Tell the reader to give up the resources. Stop the timeout cycle
+ and disconnect the transport.
+
+ """
+ self.reader.finish()
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ self.transport.stopListening()
+
+ def startProtocol(self):
+ self.started = True
+
+ def connectionRefused(self):
+ self.finish()
+
+ def datagramReceived(self, datagram):
+ if datagram.opcode == OP_ACK:
+ return self.tftp_ACK(datagram)
+ elif datagram.opcode == OP_ERROR:
+ log.msg("Got error: %s" % datagram)
+ self.cancel()
+
+ def tftp_ACK(self, datagram):
+ """Handle the incoming ACK TFTP datagram.
+
+ @type datagram: L{ACKDatagram}
+
+ """
+ if datagram.blocknum < self.blocknum:
+ log.msg("Duplicate ACK for blocknum %s" % datagram.blocknum)
+ elif datagram.blocknum == self.blocknum:
+ if self.timeout_watchdog is not None and self.timeout_watchdog.active():
+ self.timeout_watchdog.cancel()
+ if self.completed:
+ log.msg("Final ACK received, transfer successful")
+ self.cancel()
+ else:
+ return self.nextBlock()
+ else:
+ self.transport.write(ERRORDatagram.from_code(
+ ERR_ILLEGAL_OP, "Block number mismatch").to_wire())
+
+ def nextBlock(self):
+ """ACK datagram for the previous block has been received. Attempt to read
+ the next block, that will be sent.
+
+ """
+ self.blocknum += 1
+ d = maybeDeferred(self.reader.read, self.block_size)
+ d.addCallbacks(callback=self.dataFromReader, errback=self.readFailed)
+ return d
+
+ def dataFromReader(self, data):
+ """Got data from the reader. Send it to the network and start the timeout
+ cycle.
+
+ """
+ if len(data) < self.block_size:
+ self.completed = True
+ bytes = DATADatagram(self.blocknum, data).to_wire()
+ self.timeout_watchdog = SequentialCall.run(self.timeout[:-1],
+ callable=self.sendData, callable_args=[bytes, ],
+ on_timeout=lambda: self._clock.callLater(self.timeout[-1], self.timedOut),
+ run_now=True,
+ _clock=self._clock
+ )
+
+ def readFailed(self, fail):
+ """The reader reported an error. Notify the remote end and cancel the transfer"""
+ log.err(fail)
+ self.transport.write(ERRORDatagram.from_code(ERR_NOT_DEFINED, "Read failed").to_wire())
+ self.cancel()
+
+ def timedOut(self):
+ """Timeout iterable has been exhausted. End the transfer"""
+ log.msg("Session timed out, last wait was %s seconds long" % self.timeout[-1])
+ self.cancel()
+
+ def sendData(self, bytes):
+ """Send data to the remote peer
+
+ @param bytes: bytes to send
+ @type bytes: C{str}
+
+ """
+ self.transport.write(bytes)
=== added directory 'contrib/python-tx-tftp/tftp/test'
=== added file 'contrib/python-tx-tftp/tftp/test/__init__.py'
=== added file 'contrib/python-tx-tftp/tftp/test/test_backend.py'
--- contrib/python-tx-tftp/tftp/test/test_backend.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_backend.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,170 @@
+'''
+@author: shylent
+'''
+from tftp.backend import (FilesystemSynchronousBackend, FilesystemReader,
+ FilesystemWriter, IReader, IWriter)
+from tftp.errors import Unsupported, AccessViolation, FileNotFound, FileExists
+from twisted.python.filepath import FilePath
+from twisted.internet.defer import inlineCallbacks
+from twisted.trial import unittest
+import shutil
+import tempfile
+
+
+class BackendSelection(unittest.TestCase):
+ test_data = """line1
+line2
+line3
+"""
+
+
+ def setUp(self):
+ self.temp_dir = FilePath(tempfile.mkdtemp())
+ self.existing_file_name = self.temp_dir.descendant(("dir", "foo"))
+ self.existing_file_name.parent().makedirs()
+ self.existing_file_name.setContent(self.test_data)
+
+ @inlineCallbacks
+ def test_read_supported_by_default(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ reader = yield b.get_reader('dir/foo')
+ self.assertTrue(IReader.providedBy(reader))
+
+ @inlineCallbacks
+ def test_write_supported_by_default(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ writer = yield b.get_writer('dir/bar')
+ self.assertTrue(IWriter.providedBy(writer))
+
+ def test_read_unsupported(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path, can_read=False)
+ return self.assertFailure(b.get_reader('dir/foo'), Unsupported)
+
+ def test_write_unsupported(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path, can_write=False)
+ return self.assertFailure(b.get_writer('dir/bar'), Unsupported)
+
+ def test_insecure_reader(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ return self.assertFailure(
+ b.get_reader('../foo'), AccessViolation)
+
+ def test_insecure_writer(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ return self.assertFailure(
+ b.get_writer('../foo'), AccessViolation)
+
+ @inlineCallbacks
+ def test_read_ignores_leading_and_trailing_slashes(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ reader = yield b.get_reader('/dir/foo/')
+ segments_from_root = reader.file_path.segmentsFrom(self.temp_dir)
+ self.assertEqual(["dir", "foo"], segments_from_root)
+
+ @inlineCallbacks
+ def test_write_ignores_leading_and_trailing_slashes(self):
+ b = FilesystemSynchronousBackend(self.temp_dir.path)
+ writer = yield b.get_writer('/dir/bar/')
+ segments_from_root = writer.file_path.segmentsFrom(self.temp_dir)
+ self.assertEqual(["dir", "bar"], segments_from_root)
+
+ def tearDown(self):
+ shutil.rmtree(self.temp_dir.path)
+
+
+class Reader(unittest.TestCase):
+ test_data = """line1
+line2
+line3
+"""
+
+ def setUp(self):
+ self.temp_dir = FilePath(tempfile.mkdtemp())
+ self.existing_file_name = self.temp_dir.child('foo')
+ with self.existing_file_name.open('w') as f:
+ f.write(self.test_data)
+
+ def test_file_not_found(self):
+ self.assertRaises(FileNotFound, FilesystemReader, self.temp_dir.child('bar'))
+
+ def test_read_existing_file(self):
+ r = FilesystemReader(self.temp_dir.child('foo'))
+ data = r.read(3)
+ ostring = data
+ while data:
+ data = r.read(3)
+ ostring += data
+ self.assertEqual(r.read(3), '')
+ self.assertEqual(r.read(5), '')
+ self.assertEqual(r.read(7), '')
+ self.failUnless(r.file_obj.closed,
+ "The file has been exhausted and should be in the closed state")
+ self.assertEqual(ostring, self.test_data)
+
+ def test_size(self):
+ r = FilesystemReader(self.temp_dir.child('foo'))
+ self.assertEqual(len(self.test_data), r.size)
+
+ def test_size_when_reader_finished(self):
+ r = FilesystemReader(self.temp_dir.child('foo'))
+ r.finish()
+ self.assertIsNone(r.size)
+
+ def test_size_when_file_removed(self):
+ # FilesystemReader.size uses fstat() to discover the file's size, so
+ # the absence of the file does not matter.
+ r = FilesystemReader(self.temp_dir.child('foo'))
+ self.existing_file_name.remove()
+ self.assertEqual(len(self.test_data), r.size)
+
+ def test_cancel(self):
+ r = FilesystemReader(self.temp_dir.child('foo'))
+ r.read(3)
+ r.finish()
+ self.failUnless(r.file_obj.closed,
+
+ "The session has been finished, so the file object should be in the closed state")
+ r.finish()
+
+ def tearDown(self):
+ self.temp_dir.remove()
+
+
+class Writer(unittest.TestCase):
+ test_data = """line1
+line2
+line3
+"""
+
+ def setUp(self):
+ self.temp_dir = FilePath(tempfile.mkdtemp())
+ self.existing_file_name = self.temp_dir.child('foo')
+ self.existing_file_name.setContent(self.test_data)
+
+ def test_write_existing_file(self):
+ self.assertRaises(FileExists, FilesystemWriter, self.temp_dir.child('foo'))
+
+ def test_write_to_non_existent_directory(self):
+ new_directory = self.temp_dir.child("new")
+ new_file = new_directory.child("baz")
+ self.assertFalse(new_directory.exists())
+ FilesystemWriter(new_file).finish()
+ self.assertTrue(new_directory.exists())
+ self.assertTrue(new_file.exists())
+
+ def test_finished_write(self):
+ w = FilesystemWriter(self.temp_dir.child('bar'))
+ w.write(self.test_data)
+ w.finish()
+ with self.temp_dir.child('bar').open() as f:
+ self.assertEqual(f.read(), self.test_data)
+
+ def test_cancelled_write(self):
+ w = FilesystemWriter(self.temp_dir.child('bar'))
+ w.write(self.test_data)
+ w.cancel()
+ self.failIf(self.temp_dir.child('bar').exists(),
+ "If a write is cancelled, the file should not be left behind")
+
+ def tearDown(self):
+ self.temp_dir.remove()
=== added file 'contrib/python-tx-tftp/tftp/test/test_bootstrap.py'
--- contrib/python-tx-tftp/tftp/test/test_bootstrap.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_bootstrap.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,629 @@
+'''
+@author: shylent
+'''
+from tftp.bootstrap import (LocalOriginWriteSession, LocalOriginReadSession,
+ RemoteOriginReadSession, RemoteOriginWriteSession, TFTPBootstrap)
+from tftp.datagram import (ACKDatagram, TFTPDatagramFactory, split_opcode,
+ ERR_TID_UNKNOWN, DATADatagram, OACKDatagram)
+from tftp.test.test_sessions import DelayedWriter, FakeTransport, DelayedReader
+from twisted.internet import reactor
+from twisted.internet.defer import inlineCallbacks
+from twisted.internet.task import Clock
+from twisted.python.filepath import FilePath
+from twisted.python.util import OrderedDict
+from twisted.trial import unittest
+import shutil
+import tempfile
+from tftp.session import MAX_BLOCK_SIZE, WriteSession, ReadSession
+
+ReadSession.timeout = (2, 2, 2)
+WriteSession.timeout = (2, 2, 2)
+RemoteOriginReadSession.timeout = (2, 2, 2)
+RemoteOriginWriteSession.timeout = (2, 2, 2)
+
+class MockHandshakeWatchdog(object):
+
+ def __init__(self, when, f, args=None, kwargs=None, _clock=None):
+ self._clock = _clock
+ self.when = when
+ self.f = f
+ self.args = args or []
+ self.kwargs = kwargs or {}
+ if _clock is None:
+ self._clock = reactor
+ else:
+ self._clock = _clock
+
+ def start(self):
+ self.wd = self._clock.callLater(self.when, self.f, *self.args, **self.kwargs)
+
+ def cancel(self):
+ if self.wd.active():
+ self.wd.cancel()
+
+ def active(self):
+ return self.wd.active()
+
+class MockSession(object):
+ block_size = 512
+ timeout = (1, 3, 5)
+ tsize = None
+
+# Testing implementation here, but if I don't, I'll have a TON of duplicate code
+class TestOptionProcessing(unittest.TestCase):
+
+ def setUp(self):
+ self.proto = TFTPBootstrap(('127.0.0.1', 1111), None)
+
+ def test_empty_options(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict())
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, 512)
+ self.assertEqual(self.s.timeout, (1, 3, 5))
+
+ def test_blksize(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'blksize':'8'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, 8)
+ self.assertEqual(opts, OrderedDict({'blksize':'8'}))
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'blksize':'foo'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, 512)
+ self.assertEqual(opts, OrderedDict())
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'blksize':'65464'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, MAX_BLOCK_SIZE)
+ self.assertEqual(opts, OrderedDict({'blksize':str(MAX_BLOCK_SIZE)}))
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'blksize':'65465'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, 512)
+ self.assertEqual(opts, OrderedDict())
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'blksize':'7'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.block_size, 512)
+ self.assertEqual(opts, OrderedDict())
+
+ def test_timeout(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'timeout':'1'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (1, 1, 1))
+ self.assertEqual(opts, OrderedDict({'timeout':'1'}))
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'timeout':'foo'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (1, 3, 5))
+ self.assertEqual(opts, OrderedDict())
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'timeout':'0'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (1, 3, 5))
+ self.assertEqual(opts, OrderedDict())
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'timeout':'255'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (255, 255, 255))
+ self.assertEqual(opts, OrderedDict({'timeout':'255'}))
+
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'timeout':'256'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (1, 3, 5))
+ self.assertEqual(opts, OrderedDict())
+
+ def test_tsize(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'tsize':'1'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.tsize, 1)
+ self.assertEqual(opts, OrderedDict({'tsize':'1'}))
+
+ def test_tsize_ignored_when_not_a_number(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'tsize':'foo'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertIsNone(self.s.tsize)
+ self.assertEqual(opts, OrderedDict({}))
+
+ def test_tsize_ignored_when_less_than_zero(self):
+ self.s = MockSession()
+ opts = self.proto.processOptions(OrderedDict({'tsize':'-1'}))
+ self.proto.applyOptions(self.s, opts)
+ self.assertIsNone(self.s.tsize)
+ self.assertEqual(opts, OrderedDict({}))
+
+ def test_multiple_options(self):
+ got_options = OrderedDict()
+ got_options['timeout'] = '123'
+ got_options['blksize'] = '1024'
+ self.s = MockSession()
+ opts = self.proto.processOptions(got_options)
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (123, 123, 123))
+ self.assertEqual(self.s.block_size, 1024)
+ self.assertEqual(opts.items(), got_options.items())
+
+ got_options = OrderedDict()
+ got_options['blksize'] = '1024'
+ got_options['timeout'] = '123'
+ self.s = MockSession()
+ opts = self.proto.processOptions(got_options)
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (123, 123, 123))
+ self.assertEqual(self.s.block_size, 1024)
+ self.assertEqual(opts.items(), got_options.items())
+
+ got_options = OrderedDict()
+ got_options['blksize'] = '1024'
+ got_options['foobar'] = 'barbaz'
+ got_options['timeout'] = '123'
+ self.s = MockSession()
+ opts = self.proto.processOptions(got_options)
+ self.proto.applyOptions(self.s, opts)
+ self.assertEqual(self.s.timeout, (123, 123, 123))
+ self.assertEqual(self.s.block_size, 1024)
+ actual_options = OrderedDict()
+ actual_options['blksize'] = '1024'
+ actual_options['timeout'] = '123'
+ self.assertEqual(opts.items(), actual_options.items())
+
+
+class BootstrapLocalOriginWrite(unittest.TestCase):
+
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.ws = LocalOriginWriteSession(('127.0.0.1', 65465), self.writer, _clock=self.clock)
+ self.wd = MockHandshakeWatchdog(4, self.ws.timedOut, _clock=self.clock)
+ self.ws.timeout_watchdog = self.wd
+ self.ws.transport = self.transport
+
+ def test_invalid_tid(self):
+ self.ws.startProtocol()
+ bad_tid_dgram = ACKDatagram(123)
+ self.ws.datagramReceived(bad_tid_dgram.to_wire(), ('127.0.0.1', 1111))
+
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
+ self.addCleanup(self.ws.cancel)
+ #test_invalid_tid.skip = 'Will go to another test case'
+
+ def test_local_origin_write_session_handshake_timeout(self):
+ self.ws.startProtocol()
+ self.clock.advance(5)
+ self.failIf(self.transport.value())
+ self.failUnless(self.transport.disconnecting)
+
+ def test_local_origin_write_session_handshake_success(self):
+ self.ws.session.block_size = 6
+ self.ws.startProtocol()
+ self.clock.advance(1)
+ data_datagram = DATADatagram(1, 'foobar')
+ self.ws.datagramReceived(data_datagram.to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), ACKDatagram(1).to_wire())
+ self.failIf(self.transport.disconnecting)
+ self.failIf(self.wd.active())
+ self.addCleanup(self.ws.cancel)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+class LocalOriginWriteOptionNegotiation(unittest.TestCase):
+
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.ws = LocalOriginWriteSession(('127.0.0.1', 65465), self.writer,
+ options={'blksize':'123'}, _clock=self.clock)
+ self.wd = MockHandshakeWatchdog(4, self.ws.timedOut, _clock=self.clock)
+ self.ws.timeout_watchdog = self.wd
+ self.ws.transport = self.transport
+
+
+ def test_option_normal(self):
+ self.ws.startProtocol()
+ self.ws.datagramReceived(OACKDatagram({'blksize':'12'}).to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(0.1)
+ self.assertEqual(self.ws.session.block_size, WriteSession.block_size)
+ self.assertEqual(self.transport.value(), ACKDatagram(0).to_wire())
+
+ self.transport.clear()
+ self.ws.datagramReceived(OACKDatagram({'blksize':'9'}).to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(0.1)
+ self.assertEqual(self.ws.session.block_size, WriteSession.block_size)
+ self.assertEqual(self.transport.value(), ACKDatagram(0).to_wire())
+
+ self.transport.clear()
+ self.ws.datagramReceived(DATADatagram(1, 'foobarbaz').to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(3)
+ self.failUnless(self.ws.session.started)
+ self.clock.advance(0.1)
+ self.assertEqual(self.ws.session.block_size, 9)
+ self.assertEqual(self.transport.value(), ACKDatagram(1).to_wire())
+
+ self.transport.clear()
+ self.ws.datagramReceived(DATADatagram(2, 'asdfghjkl').to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(3)
+ self.assertEqual(self.transport.value(), ACKDatagram(2).to_wire())
+ self.writer.finish()
+ self.assertEqual(self.writer.file_path.open('r').read(), 'foobarbazasdfghjkl')
+
+ self.transport.clear()
+ self.ws.datagramReceived(OACKDatagram({'blksize':'12'}).to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(0.1)
+ self.assertEqual(self.ws.session.block_size, 9)
+ self.assertEqual(self.transport.value(), ACKDatagram(0).to_wire())
+
+ def test_option_timeout(self):
+ self.ws.startProtocol()
+ self.clock.advance(5)
+ self.failUnless(self.transport.disconnecting)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+class BootstrapRemoteOriginWrite(unittest.TestCase):
+
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.ws = RemoteOriginWriteSession(('127.0.0.1', 65465), self.writer, _clock=self.clock)
+ self.ws.transport = self.transport
+ self.ws.startProtocol()
+
+ @inlineCallbacks
+ def test_invalid_tid(self):
+ bad_tid_dgram = ACKDatagram(123)
+ yield self.ws.datagramReceived(bad_tid_dgram.to_wire(), ('127.0.0.1', 1111))
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
+ self.addCleanup(self.ws.cancel)
+
+ def test_remote_origin_write_bootstrap(self):
+ # Initial ACK
+ ack_datagram_0 = ACKDatagram(0)
+ self.clock.advance(0.1)
+ self.assertEqual(self.transport.value(), ack_datagram_0.to_wire())
+ self.failIf(self.transport.disconnecting)
+
+ # Normal exchange
+ self.transport.clear()
+ d = self.ws.datagramReceived(DATADatagram(1, 'foobar').to_wire(), ('127.0.0.1', 65465))
+ def cb(res):
+ self.clock.advance(0.1)
+ ack_datagram_1 = ACKDatagram(1)
+ self.assertEqual(self.transport.value(), ack_datagram_1.to_wire())
+ self.assertEqual(self.target.open('r').read(), 'foobar')
+ self.failIf(self.transport.disconnecting)
+ self.addCleanup(self.ws.cancel)
+ d.addCallback(cb)
+ self.clock.advance(3)
+ return d
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class RemoteOriginWriteOptionNegotiation(unittest.TestCase):
+
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.options = OrderedDict()
+ self.options['blksize'] = '9'
+ self.options['tsize'] = '45'
+ self.ws = RemoteOriginWriteSession(
+ ('127.0.0.1', 65465), self.writer, options=self.options,
+ _clock=self.clock)
+ self.ws.transport = self.transport
+
+ def test_option_normal(self):
+ self.ws.startProtocol()
+ self.clock.advance(0.1)
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+ self.clock.advance(3)
+ self.assertEqual(self.transport.value(), oack_datagram * 2)
+
+ self.transport.clear()
+ self.ws.datagramReceived(DATADatagram(1, 'foobarbaz').to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), ACKDatagram(1).to_wire())
+ self.assertEqual(self.ws.session.block_size, 9)
+
+ self.transport.clear()
+ self.ws.datagramReceived(DATADatagram(2, 'smthng').to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), ACKDatagram(2).to_wire())
+ self.clock.pump((1,)*10)
+ self.writer.finish()
+ self.assertEqual(self.writer.file_path.open('r').read(), 'foobarbazsmthng')
+ self.failUnless(self.transport.disconnecting)
+
+ def test_option_timeout(self):
+ self.ws.startProtocol()
+ self.clock.advance(0.1)
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(3)
+ self.assertEqual(self.transport.value(), oack_datagram * 2)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(2)
+ self.assertEqual(self.transport.value(), oack_datagram * 3)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(2)
+ self.assertEqual(self.transport.value(), oack_datagram * 3)
+ self.failUnless(self.transport.disconnecting)
+
+ def test_option_tsize(self):
+ # A tsize option sent as part of a write session is recorded.
+ self.ws.startProtocol()
+ self.clock.advance(0.1)
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+ self.failIf(self.transport.disconnecting)
+ self.assertIsInstance(self.ws.session, WriteSession)
+ # Options are not applied to the WriteSession until the first DATA
+ # datagram is received,
+ self.assertIsNone(self.ws.session.tsize)
+ self.ws.datagramReceived(
+ DATADatagram(1, 'foobarbaz').to_wire(), ('127.0.0.1', 65465))
+ # The tsize option has been applied to the WriteSession.
+ self.assertEqual(45, self.ws.session.tsize)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class BootstrapLocalOriginRead(unittest.TestCase):
+ test_data = """line1
+line2
+anotherline"""
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ with self.target.open('wb') as temp_fd:
+ temp_fd.write(self.test_data)
+ self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.rs = LocalOriginReadSession(('127.0.0.1', 65465), self.reader, _clock=self.clock)
+ self.wd = MockHandshakeWatchdog(4, self.rs.timedOut, _clock=self.clock)
+ self.rs.timeout_watchdog = self.wd
+ self.rs.transport = self.transport
+ self.rs.startProtocol()
+
+ def test_invalid_tid(self):
+ data_datagram = DATADatagram(1, 'foobar')
+ self.rs.datagramReceived(data_datagram, ('127.0.0.1', 11111))
+ self.clock.advance(0.1)
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
+ self.addCleanup(self.rs.cancel)
+
+ def test_local_origin_read_session_handshake_timeout(self):
+ self.clock.advance(5)
+ self.failIf(self.transport.value())
+ self.failUnless(self.transport.disconnecting)
+
+ def test_local_origin_read_session_handshake_success(self):
+ self.clock.advance(1)
+ ack_datagram = ACKDatagram(0)
+ self.rs.datagramReceived(ack_datagram.to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(2)
+ self.failUnless(self.transport.value())
+ self.failIf(self.transport.disconnecting)
+ self.failIf(self.wd.active())
+ self.addCleanup(self.rs.cancel)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class LocalOriginReadOptionNegotiation(unittest.TestCase):
+ test_data = """line1
+line2
+anotherline"""
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ with self.target.open('wb') as temp_fd:
+ temp_fd.write(self.test_data)
+ self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.rs = LocalOriginReadSession(('127.0.0.1', 65465), self.reader, _clock=self.clock)
+ self.wd = MockHandshakeWatchdog(4, self.rs.timedOut, _clock=self.clock)
+ self.rs.timeout_watchdog = self.wd
+ self.rs.transport = self.transport
+
+ def test_option_normal(self):
+ self.rs.startProtocol()
+ self.rs.datagramReceived(OACKDatagram({'blksize':'9'}).to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(0.1)
+ self.assertEqual(self.rs.session.block_size, 9)
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), DATADatagram(1, self.test_data[:9]).to_wire())
+
+ self.rs.datagramReceived(OACKDatagram({'blksize':'12'}).to_wire(), ('127.0.0.1', 65465))
+ self.clock.advance(0.1)
+ self.assertEqual(self.rs.session.block_size, 9)
+
+ self.transport.clear()
+ self.rs.datagramReceived(ACKDatagram(1).to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), DATADatagram(2, self.test_data[9:18]).to_wire())
+
+ self.addCleanup(self.rs.cancel)
+
+ def test_local_origin_read_option_timeout(self):
+ self.rs.startProtocol()
+ self.clock.advance(5)
+ self.failUnless(self.transport.disconnecting)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class BootstrapRemoteOriginRead(unittest.TestCase):
+ test_data = """line1
+line2
+anotherline"""
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ with self.target.open('wb') as temp_fd:
+ temp_fd.write(self.test_data)
+ self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.rs = RemoteOriginReadSession(('127.0.0.1', 65465), self.reader, _clock=self.clock)
+ self.rs.transport = self.transport
+
+ @inlineCallbacks
+ def test_invalid_tid(self):
+ self.rs.startProtocol()
+ data_datagram = DATADatagram(1, 'foobar')
+ yield self.rs.datagramReceived(data_datagram, ('127.0.0.1', 11111))
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(err_dgram.errorcode, ERR_TID_UNKNOWN)
+ self.addCleanup(self.rs.cancel)
+
+ def test_remote_origin_read_bootstrap(self):
+ # First datagram
+ self.rs.session.block_size = 5
+ self.rs.startProtocol()
+ self.clock.pump((1,)*3)
+
+ data_datagram_1 = DATADatagram(1, self.test_data[:5])
+
+ self.assertEqual(self.transport.value(), data_datagram_1.to_wire())
+ self.failIf(self.transport.disconnecting)
+
+ # Normal exchange continues
+ self.transport.clear()
+ self.rs.datagramReceived(ACKDatagram(1).to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ data_datagram_2 = DATADatagram(2, self.test_data[5:10])
+ self.assertEqual(self.transport.value(), data_datagram_2.to_wire())
+ self.failIf(self.transport.disconnecting)
+ self.addCleanup(self.rs.cancel)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class RemoteOriginReadOptionNegotiation(unittest.TestCase):
+ test_data = """line1
+line2
+anotherline"""
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ with self.target.open('wb') as temp_fd:
+ temp_fd.write(self.test_data)
+ self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.options = OrderedDict()
+ self.options['blksize'] = '9'
+ self.options['tsize'] = '34'
+ self.rs = RemoteOriginReadSession(('127.0.0.1', 65465), self.reader,
+ options=self.options, _clock=self.clock)
+ self.rs.transport = self.transport
+
+ def test_option_normal(self):
+ self.rs.startProtocol()
+ self.clock.advance(0.1)
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+ self.clock.advance(3)
+ self.assertEqual(self.transport.value(), oack_datagram * 2)
+
+ self.transport.clear()
+ self.rs.datagramReceived(ACKDatagram(0).to_wire(), ('127.0.0.1', 65465))
+ self.clock.pump((1,)*3)
+ self.assertEqual(self.transport.value(), DATADatagram(1, self.test_data[:9]).to_wire())
+
+ self.addCleanup(self.rs.cancel)
+
+ def test_option_timeout(self):
+ self.rs.startProtocol()
+ self.clock.advance(0.1)
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(3)
+ self.assertEqual(self.transport.value(), oack_datagram * 2)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(2)
+ self.assertEqual(self.transport.value(), oack_datagram * 3)
+ self.failIf(self.transport.disconnecting)
+
+ self.clock.advance(2)
+ self.assertEqual(self.transport.value(), oack_datagram * 3)
+ self.failUnless(self.transport.disconnecting)
+
+ def test_option_tsize(self):
+ # A tsize option of 0 sent as part of a read session prompts a tsize
+ # response with the actual size of the file.
+ self.options['tsize'] = '0'
+ self.rs.startProtocol()
+ self.clock.advance(0.1)
+ self.transport.clear()
+ self.clock.advance(3)
+ # The response contains the size of the test data.
+ self.options['tsize'] = str(len(self.test_data))
+ oack_datagram = OACKDatagram(self.options).to_wire()
+ self.assertEqual(self.transport.value(), oack_datagram)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
=== added file 'contrib/python-tx-tftp/tftp/test/test_netascii.py'
--- contrib/python-tx-tftp/tftp/test/test_netascii.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_netascii.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,195 @@
+'''
+@author: shylent
+'''
+from cStringIO import StringIO
+from tftp.netascii import (from_netascii, to_netascii, NetasciiReceiverProxy,
+ NetasciiSenderProxy)
+from twisted.internet.defer import inlineCallbacks
+from twisted.trial import unittest
+import re
+import tftp
+
+
+class FromNetascii(unittest.TestCase):
+
+ def setUp(self):
+ self._orig_nl = tftp.netascii.NL
+
+ def test_lf_newline(self):
+ tftp.netascii.NL = '\x0a'
+ self.assertEqual(from_netascii('\x0d\x00'), '\x0d')
+ self.assertEqual(from_netascii('\x0d\x0a'), '\x0a')
+ self.assertEqual(from_netascii('foo\x0d\x0a\x0abar'), 'foo\x0a\x0abar')
+ self.assertEqual(from_netascii('foo\x0d\x0a\x0abar'), 'foo\x0a\x0abar')
+ # freestanding CR should not occur, but handle it anyway
+ self.assertEqual(from_netascii('foo\x0d\x0a\x0dbar'), 'foo\x0a\x0dbar')
+
+ def test_cr_newline(self):
+ tftp.netascii.NL = '\x0d'
+ self.assertEqual(from_netascii('\x0d\x00'), '\x0d')
+ self.assertEqual(from_netascii('\x0d\x0a'), '\x0d')
+ self.assertEqual(from_netascii('foo\x0d\x0a\x0abar'), 'foo\x0d\x0abar')
+ self.assertEqual(from_netascii('foo\x0d\x0a\x00bar'), 'foo\x0d\x00bar')
+ self.assertEqual(from_netascii('foo\x0d\x00\x0abar'), 'foo\x0d\x0abar')
+
+ def test_crlf_newline(self):
+ tftp.netascii.NL = '\x0d\x0a'
+ self.assertEqual(from_netascii('\x0d\x00'), '\x0d')
+ self.assertEqual(from_netascii('\x0d\x0a'), '\x0d\x0a')
+ self.assertEqual(from_netascii('foo\x0d\x00\x0abar'), 'foo\x0d\x0abar')
+
+ def tearDown(self):
+ tftp.netascii.NL = self._orig_nl
+
+
+class ToNetascii(unittest.TestCase):
+
+ def setUp(self):
+ self._orig_nl = tftp.netascii.NL
+ self._orig_nl_regex = tftp.netascii.re_to_netascii
+
+ def test_lf_newline(self):
+ tftp.netascii.NL = '\x0a'
+ tftp.netascii.re_to_netascii = re.compile(tftp.netascii._re_to_netascii %
+ tftp.netascii.NL)
+ self.assertEqual(to_netascii('\x0d'), '\x0d\x00')
+ self.assertEqual(to_netascii('\x0a'), '\x0d\x0a')
+ self.assertEqual(to_netascii('\x0a\x0d'), '\x0d\x0a\x0d\x00')
+ self.assertEqual(to_netascii('\x0d\x0a'), '\x0d\x00\x0d\x0a')
+
+ def test_cr_newline(self):
+ tftp.netascii.NL = '\x0d'
+ tftp.netascii.re_to_netascii = re.compile(tftp.netascii._re_to_netascii %
+ tftp.netascii.NL)
+ self.assertEqual(to_netascii('\x0d'), '\x0d\x0a')
+ self.assertEqual(to_netascii('\x0a'), '\x0a')
+ self.assertEqual(to_netascii('\x0d\x0a'), '\x0d\x0a\x0a')
+ self.assertEqual(to_netascii('\x0a\x0d'), '\x0a\x0d\x0a')
+
+ def test_crlf_newline(self):
+ tftp.netascii.NL = '\x0d\x0a'
+ tftp.netascii.re_to_netascii = re.compile(tftp.netascii._re_to_netascii %
+ tftp.netascii.NL)
+ self.assertEqual(to_netascii('\x0d\x0a'), '\x0d\x0a')
+ self.assertEqual(to_netascii('\x0d'), '\x0d\x00')
+ self.assertEqual(to_netascii('\x0d\x0a\x0d'), '\x0d\x0a\x0d\x00')
+ self.assertEqual(to_netascii('\x0d\x0d\x0a'), '\x0d\x00\x0d\x0a')
+
+ def tearDown(self):
+ tftp.netascii.NL = self._orig_nl
+ tftp.netascii.re_to_netascii = self._orig_nl_regex
+
+
+class ReceiverProxy(unittest.TestCase):
+
+ test_data = """line1
+line2
+line3
+"""
+ def setUp(self):
+ self.source = StringIO(to_netascii(self.test_data))
+ self.sink = StringIO()
+
+ @inlineCallbacks
+ def test_conversion(self):
+ p = NetasciiReceiverProxy(self.sink)
+ chunk = self.source.read(2)
+ while chunk:
+ yield p.write(chunk)
+ chunk = self.source.read(2)
+ self.sink.seek(0) # !!!
+ self.assertEqual(self.sink.read(), self.test_data)
+
+ @inlineCallbacks
+ def test_conversion_byte_by_byte(self):
+ p = NetasciiReceiverProxy(self.sink)
+ chunk = self.source.read(1)
+ while chunk:
+ yield p.write(chunk)
+ chunk = self.source.read(1)
+ self.sink.seek(0) # !!!
+ self.assertEqual(self.sink.read(), self.test_data)
+
+ @inlineCallbacks
+ def test_conversion_normal(self):
+ p = NetasciiReceiverProxy(self.sink)
+ chunk = self.source.read(1)
+ while chunk:
+ yield p.write(chunk)
+ chunk = self.source.read(5)
+ self.sink.seek(0) # !!!
+ self.assertEqual(self.sink.read(), self.test_data)
+
+
+class SenderProxy(unittest.TestCase):
+
+ test_data = """line1
+line2
+line3
+"""
+ def setUp(self):
+ self.source = StringIO(self.test_data)
+ self.sink = StringIO()
+
+ @inlineCallbacks
+ def test_conversion_normal(self):
+ p = NetasciiSenderProxy(self.source)
+ chunk = yield p.read(5)
+ self.assertEqual(len(chunk), 5)
+ self.sink.write(chunk)
+ last_chunk = False
+ while chunk:
+ chunk = yield p.read(5)
+ # If a terminating chunk (len < blocknum) was already sent, there should
+ # be no more data (means, we can only yield empty lines from now on)
+ if last_chunk and chunk:
+ print "LEN: %s" % len(chunk)
+ self.fail("Last chunk (with len < blocksize) was already yielded, "
+ "but there is more data.")
+ if len(chunk) < 5:
+ last_chunk = True
+ self.sink.write(chunk)
+ self.sink.seek(0)
+ self.assertEqual(self.sink.read(), to_netascii(self.test_data))
+
+ @inlineCallbacks
+ def test_conversion_byte_by_byte(self):
+ p = NetasciiSenderProxy(self.source)
+ chunk = yield p.read(1)
+ self.assertEqual(len(chunk), 1)
+ self.sink.write(chunk)
+ last_chunk = False
+ while chunk:
+ chunk = yield p.read(1)
+ # If a terminating chunk (len < blocknum) was already sent, there should
+ # be no more data (means, we can only yield empty lines from now on)
+ if last_chunk and chunk:
+ print "LEN: %s" % len(chunk)
+ self.fail("Last chunk (with len < blocksize) was already yielded, "
+ "but there is more data.")
+ if len(chunk) < 1:
+ last_chunk = True
+ self.sink.write(chunk)
+ self.sink.seek(0)
+ self.assertEqual(self.sink.read(), to_netascii(self.test_data))
+
+ @inlineCallbacks
+ def test_conversion(self):
+ p = NetasciiSenderProxy(self.source)
+ chunk = yield p.read(2)
+ self.assertEqual(len(chunk), 2)
+ self.sink.write(chunk)
+ last_chunk = False
+ while chunk:
+ chunk = yield p.read(2)
+ # If a terminating chunk (len < blocknum) was already sent, there should
+ # be no more data (means, we can only yield empty lines from now on)
+ if last_chunk and chunk:
+ print "LEN: %s" % len(chunk)
+ self.fail("Last chunk (with len < blocksize) was already yielded, "
+ "but there is more data.")
+ if len(chunk) < 2:
+ last_chunk = True
+ self.sink.write(chunk)
+ self.sink.seek(0)
+ self.assertEqual(self.sink.read(), to_netascii(self.test_data))
=== added file 'contrib/python-tx-tftp/tftp/test/test_protocol.py'
--- contrib/python-tx-tftp/tftp/test/test_protocol.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_protocol.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,320 @@
+'''
+@author: shylent
+'''
+from tftp.backend import FilesystemSynchronousBackend, IReader, IWriter
+from tftp.bootstrap import RemoteOriginWriteSession, RemoteOriginReadSession
+from tftp.datagram import (WRQDatagram, TFTPDatagramFactory, split_opcode,
+ ERR_ILLEGAL_OP, RRQDatagram, ERR_ACCESS_VIOLATION, ERR_FILE_EXISTS,
+ ERR_FILE_NOT_FOUND, ERR_NOT_DEFINED)
+from tftp.errors import (Unsupported, AccessViolation, FileExists, FileNotFound,
+ BackendError)
+from tftp.netascii import NetasciiReceiverProxy, NetasciiSenderProxy
+from tftp.protocol import TFTP
+from twisted.internet import reactor
+from twisted.internet.address import IPv4Address
+from twisted.internet.defer import Deferred, inlineCallbacks
+from twisted.internet.protocol import DatagramProtocol
+from twisted.internet.task import Clock
+from twisted.python import context
+from twisted.python.filepath import FilePath
+from twisted.test.proto_helpers import StringTransport
+from twisted.trial import unittest
+import tempfile
+
+
+class DummyBackend(object):
+ pass
+
+def BackendFactory(exc_val=None):
+ if exc_val is not None:
+ class FailingBackend(object):
+ def get_reader(self, filename):
+ raise exc_val
+ def get_writer(self, filename):
+ raise exc_val
+ return FailingBackend()
+ else:
+ return DummyBackend()
+
+
+class FakeTransport(StringTransport):
+ stopListening = StringTransport.loseConnection
+
+ def write(self, bytes, addr=None):
+ StringTransport.write(self, bytes)
+
+ def connect(self, host, port):
+ self._connectedAddr = (host, port)
+
+
+class DispatchErrors(unittest.TestCase):
+ port = 11111
+
+ def setUp(self):
+ self.clock = Clock()
+ self.transport = FakeTransport(
+ hostAddress=IPv4Address('UDP', '127.0.0.1', self.port))
+
+ def test_malformed_datagram(self):
+ tftp = TFTP(BackendFactory(), _clock=self.clock)
+ tftp.datagramReceived('foobar', ('127.0.0.1', 1111))
+ self.failIf(self.transport.disconnecting)
+ self.failIf(self.transport.value())
+ test_malformed_datagram.skip = 'Not done yet'
+
+ def test_bad_mode(self):
+ tftp = TFTP(DummyBackend(), _clock=self.clock)
+ tftp.transport = self.transport
+ wrq_datagram = WRQDatagram('foobar', 'badmode', {})
+ tftp.datagramReceived(wrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_ILLEGAL_OP)
+
+ def test_unsupported(self):
+ tftp = TFTP(BackendFactory(Unsupported("I don't support you")), _clock=self.clock)
+ tftp.transport = self.transport
+ wrq_datagram = WRQDatagram('foobar', 'netascii', {})
+ tftp.datagramReceived(wrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_ILLEGAL_OP)
+
+ self.transport.clear()
+ rrq_datagram = RRQDatagram('foobar', 'octet', {})
+ tftp.datagramReceived(rrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_ILLEGAL_OP)
+
+ def test_access_violation(self):
+ tftp = TFTP(BackendFactory(AccessViolation("No!")), _clock=self.clock)
+ tftp.transport = self.transport
+ wrq_datagram = WRQDatagram('foobar', 'netascii', {})
+ tftp.datagramReceived(wrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_ACCESS_VIOLATION)
+
+ self.transport.clear()
+ rrq_datagram = RRQDatagram('foobar', 'octet', {})
+ tftp.datagramReceived(rrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_ACCESS_VIOLATION)
+
+ def test_file_exists(self):
+ tftp = TFTP(BackendFactory(FileExists("Already have one")), _clock=self.clock)
+ tftp.transport = self.transport
+ wrq_datagram = WRQDatagram('foobar', 'netascii', {})
+ tftp.datagramReceived(wrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_FILE_EXISTS)
+
+ def test_file_not_found(self):
+ tftp = TFTP(BackendFactory(FileNotFound("Not found")), _clock=self.clock)
+ tftp.transport = self.transport
+ rrq_datagram = RRQDatagram('foobar', 'netascii', {})
+ tftp.datagramReceived(rrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_FILE_NOT_FOUND)
+
+ def test_generic_backend_error(self):
+ tftp = TFTP(BackendFactory(BackendError("A backend that couldn't")), _clock=self.clock)
+ tftp.transport = self.transport
+ rrq_datagram = RRQDatagram('foobar', 'netascii', {})
+ tftp.datagramReceived(rrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_NOT_DEFINED)
+
+ self.transport.clear()
+ rrq_datagram = RRQDatagram('foobar', 'octet', {})
+ tftp.datagramReceived(rrq_datagram.to_wire(), ('127.0.0.1', 1111))
+ self.clock.advance(1)
+ error_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(error_datagram.errorcode, ERR_NOT_DEFINED)
+
+class DummyClient(DatagramProtocol):
+
+ def __init__(self, *args, **kwargs):
+ self.ready = Deferred()
+
+ def startProtocol(self):
+ self.ready.callback(None)
+
+class TFTPWrapper(TFTP):
+
+ def _startSession(self, *args, **kwargs):
+ d = TFTP._startSession(self, *args, **kwargs)
+
+ def save_session(session):
+ self.session = session
+ return session
+
+ d.addCallback(save_session)
+ return d
+
+
+class SuccessfulDispatch(unittest.TestCase):
+
+ def setUp(self):
+ self.tmp_dir_path = tempfile.mkdtemp()
+ with FilePath(self.tmp_dir_path).child('nonempty').open('w') as fd:
+ fd.write('Something uninteresting')
+ self.backend = FilesystemSynchronousBackend(self.tmp_dir_path)
+ self.tftp = TFTPWrapper(self.backend)
+ self.client = DummyClient()
+ reactor.listenUDP(0, self.client)
+ self.server_port = reactor.listenUDP(1069, self.tftp)
+
+ # Ok. I am going to hell for these two tests
+ def test_WRQ(self):
+ self.client.transport.write(WRQDatagram('foobar', 'NetASCiI', {}).to_wire(), ('127.0.0.1', 1069))
+ d = Deferred()
+ def cb(ign):
+ self.assertIsInstance(self.tftp.session, RemoteOriginWriteSession)
+ self.assertIsInstance(self.tftp.session.backend, NetasciiReceiverProxy)
+ self.tftp.session.cancel()
+ d.addCallback(cb)
+ reactor.callLater(0.5, d.callback, None)
+ return d
+
+ def test_RRQ(self):
+ self.client.transport.write(RRQDatagram('nonempty', 'NetASCiI', {}).to_wire(), ('127.0.0.1', 1069))
+ d = Deferred()
+ def cb(ign):
+ self.assertIsInstance(self.tftp.session, RemoteOriginReadSession)
+ self.assertIsInstance(self.tftp.session.backend, NetasciiSenderProxy)
+ self.tftp.session.cancel()
+ d.addCallback(cb)
+ reactor.callLater(0.5, d.callback, None)
+ return d
+
+ def tearDown(self):
+ self.tftp.transport.stopListening()
+ self.client.transport.stopListening()
+
+
+class FilesystemAsyncBackend(FilesystemSynchronousBackend):
+
+ def __init__(self, base_path, clock):
+ super(FilesystemAsyncBackend, self).__init__(
+ base_path, can_read=True, can_write=True)
+ self.clock = clock
+
+ def get_reader(self, file_name):
+ d_get = super(FilesystemAsyncBackend, self).get_reader(file_name)
+ d = Deferred()
+ # d_get has already fired, so don't chain d_get to d until later,
+ # otherwise d will be fired too early.
+ self.clock.callLater(0, d_get.chainDeferred, d)
+ return d
+
+ def get_writer(self, file_name):
+ d_get = super(FilesystemAsyncBackend, self).get_writer(file_name)
+ d = Deferred()
+ # d_get has already fired, so don't chain d_get to d until later,
+ # otherwise d will be fired too early.
+ self.clock.callLater(0, d_get.chainDeferred, d)
+ return d
+
+
+class SuccessfulAsyncDispatch(unittest.TestCase):
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ with FilePath(self.tmp_dir_path).child('nonempty').open('w') as fd:
+ fd.write('Something uninteresting')
+ self.backend = FilesystemAsyncBackend(self.tmp_dir_path, self.clock)
+ self.tftp = TFTP(self.backend, self.clock)
+
+ def test_get_reader_defers(self):
+ rrq_datagram = RRQDatagram('nonempty', 'NetASCiI', {})
+ rrq_addr = ('127.0.0.1', 1069)
+ rrq_mode = "octet"
+ d = self.tftp._startSession(rrq_datagram, rrq_addr, rrq_mode)
+ self.assertFalse(d.called)
+ self.clock.advance(1)
+ self.assertTrue(d.called)
+ self.assertTrue(IReader.providedBy(d.result.backend))
+
+ def test_get_writer_defers(self):
+ wrq_datagram = WRQDatagram('foobar', 'NetASCiI', {})
+ wrq_addr = ('127.0.0.1', 1069)
+ wrq_mode = "octet"
+ d = self.tftp._startSession(wrq_datagram, wrq_addr, wrq_mode)
+ self.assertFalse(d.called)
+ self.clock.advance(1)
+ self.assertTrue(d.called)
+ self.assertTrue(IWriter.providedBy(d.result.backend))
+
+
+class CapturedContext(Exception):
+ """A donkey, to carry the call context back up the stack."""
+
+ def __init__(self, args, names):
+ super(CapturedContext, self).__init__(*args)
+ self.context = {name: context.get(name) for name in names}
+
+
+class ContextCapturingBackend(object):
+ """A fake `IBackend` that raises `CapturedContext`.
+
+ Calling `get_reader` or `get_writer` raises a `CapturedContext` exception,
+ which captures the values of the call context for the given `names`.
+ """
+
+ def __init__(self, *names):
+ self.names = names
+
+ def get_reader(self, file_name):
+ raise CapturedContext(("get_reader", file_name), self.names)
+
+ def get_writer(self, file_name):
+ raise CapturedContext(("get_writer", file_name), self.names)
+
+
+class HostTransport(object):
+ """A fake `ITransport` that only responds to `getHost`."""
+
+ def __init__(self, host):
+ self.host = host
+
+ def getHost(self):
+ return IPv4Address("UDP", *self.host)
+
+
+class BackendCallingContext(unittest.TestCase):
+
+ def setUp(self):
+ super(BackendCallingContext, self).setUp()
+ self.backend = ContextCapturingBackend("local", "remote")
+ self.tftp = TFTP(self.backend)
+ self.tftp.transport = HostTransport(("12.34.56.78", 1234))
+
+ @inlineCallbacks
+ def test_context_rrq(self):
+ rrq_datagram = RRQDatagram('nonempty', 'NetASCiI', {})
+ rrq_addr = ('127.0.0.1', 1069)
+ error = yield self.assertFailure(
+ self.tftp._startSession(rrq_datagram, rrq_addr, "octet"),
+ CapturedContext)
+ self.assertEqual(("get_reader", rrq_datagram.filename), error.args)
+ self.assertEqual(
+ {"local": self.tftp.transport.host, "remote": rrq_addr},
+ error.context)
+
+ @inlineCallbacks
+ def test_context_wrq(self):
+ wrq_datagram = WRQDatagram('nonempty', 'NetASCiI', {})
+ wrq_addr = ('127.0.0.1', 1069)
+ error = yield self.assertFailure(
+ self.tftp._startSession(wrq_datagram, wrq_addr, "octet"),
+ CapturedContext)
+ self.assertEqual(("get_writer", wrq_datagram.filename), error.args)
+ self.assertEqual(
+ {"local": self.tftp.transport.host, "remote": wrq_addr},
+ error.context)
=== added file 'contrib/python-tx-tftp/tftp/test/test_sessions.py'
--- contrib/python-tx-tftp/tftp/test/test_sessions.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_sessions.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,374 @@
+'''
+@author: shylent
+'''
+from tftp.backend import FilesystemWriter, FilesystemReader, IReader, IWriter
+from tftp.datagram import (ACKDatagram, ERRORDatagram,
+ ERR_NOT_DEFINED, DATADatagram, TFTPDatagramFactory, split_opcode)
+from tftp.session import WriteSession, ReadSession
+from twisted.internet import reactor
+from twisted.internet.defer import Deferred, inlineCallbacks
+from twisted.internet.task import Clock
+from twisted.python.filepath import FilePath
+from twisted.test.proto_helpers import StringTransport
+from twisted.trial import unittest
+from zope import interface
+import shutil
+import tempfile
+
+ReadSession.timeout = (2, 2, 2)
+WriteSession.timeout = (2, 2, 2)
+
+class DelayedReader(FilesystemReader):
+
+ def __init__(self, *args, **kwargs):
+ self.delay = kwargs.pop('delay')
+ self._clock = kwargs.pop('_clock', reactor)
+ FilesystemReader.__init__(self, *args, **kwargs)
+
+ def read(self, size):
+ data = FilesystemReader.read(self, size)
+ d = Deferred()
+ def c(ign):
+ return data
+ d.addCallback(c)
+ self._clock.callLater(self.delay, d.callback, None)
+ return d
+
+
+class DelayedWriter(FilesystemWriter):
+
+ def __init__(self, *args, **kwargs):
+ self.delay = kwargs.pop('delay')
+ self._clock = kwargs.pop('_clock', reactor)
+ FilesystemWriter.__init__(self, *args, **kwargs)
+
+ def write(self, data):
+ d = Deferred()
+ def c(ign):
+ return FilesystemWriter.write(self, data)
+ d.addCallback(c)
+ self._clock.callLater(self.delay, d.callback, None)
+ return d
+
+
+class FailingReader(object):
+ interface.implements(IReader)
+
+ size = None
+
+ def read(self, size):
+ raise IOError('A failure')
+
+ def finish(self):
+ pass
+
+
+class FailingWriter(object):
+ interface.implements(IWriter)
+
+ def write(self, data):
+ raise IOError("I fail")
+
+ def cancel(self):
+ pass
+
+ def finish(self):
+ pass
+
+
+class FakeTransport(StringTransport):
+ stopListening = StringTransport.loseConnection
+
+ def connect(self, host, port):
+ self._connectedAddr = (host, port)
+
+
+class WriteSessions(unittest.TestCase):
+
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ self.writer = DelayedWriter(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.ws = WriteSession(self.writer, _clock=self.clock)
+ self.ws.timeout = (4, 4, 4)
+ self.ws.transport = self.transport
+ self.ws.startProtocol()
+
+ def test_ERROR(self):
+ err_dgram = ERRORDatagram.from_code(ERR_NOT_DEFINED, 'no reason')
+ self.ws.datagramReceived(err_dgram)
+ self.clock.advance(0.1)
+ self.failIf(self.transport.value())
+ self.failUnless(self.transport.disconnecting)
+
+ @inlineCallbacks
+ def test_DATA_stale_blocknum(self):
+ self.ws.block_size = 6
+ self.ws.blocknum = 2
+ data_datagram = DATADatagram(1, 'foobar')
+ yield self.ws.datagramReceived(data_datagram)
+ self.writer.finish()
+ self.failIf(self.target.open('r').read())
+ self.failIf(self.transport.disconnecting)
+ ack_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(ack_dgram.blocknum, 1)
+ self.addCleanup(self.ws.cancel)
+
+ @inlineCallbacks
+ def test_DATA_invalid_blocknum(self):
+ self.ws.block_size = 6
+ data_datagram = DATADatagram(3, 'foobar')
+ yield self.ws.datagramReceived(data_datagram)
+ self.writer.finish()
+ self.failIf(self.target.open('r').read())
+ self.failIf(self.transport.disconnecting)
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assert_(isinstance(err_dgram, ERRORDatagram))
+ self.addCleanup(self.ws.cancel)
+
+ def test_DATA(self):
+ self.ws.block_size = 6
+ data_datagram = DATADatagram(1, 'foobar')
+ d = self.ws.datagramReceived(data_datagram)
+ def cb(ign):
+ self.clock.advance(0.1)
+ #self.writer.finish()
+ #self.assertEqual(self.target.open('r').read(), 'foobar')
+ self.failIf(self.transport.disconnecting)
+ ack_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(ack_dgram.blocknum, 1)
+ self.failIf(self.ws.completed,
+ "Data length is equal to blocksize, no reason to stop")
+ data_datagram = DATADatagram(2, 'barbaz')
+
+ self.transport.clear()
+ d = self.ws.datagramReceived(data_datagram)
+ d.addCallback(cb_)
+ self.clock.advance(3)
+ return d
+ def cb_(ign):
+ self.clock.advance(0.1)
+ self.failIf(self.transport.disconnecting)
+ ack_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(ack_dgram.blocknum, 2)
+ self.failIf(self.ws.completed,
+ "Data length is equal to blocksize, no reason to stop")
+ d.addCallback(cb)
+ self.addCleanup(self.ws.cancel)
+ self.clock.advance(3)
+ return d
+
+ def test_DATA_finished(self):
+ self.ws.block_size = 6
+
+ # Send a terminating datagram
+ data_datagram = DATADatagram(1, 'foo')
+ d = self.ws.datagramReceived(data_datagram)
+ def cb(res):
+ self.clock.advance(0.1)
+ self.assertEqual(self.target.open('r').read(), 'foo')
+ ack_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.failUnless(isinstance(ack_dgram, ACKDatagram))
+ self.failUnless(self.ws.completed,
+ "Data length is less, than blocksize, time to stop")
+ self.transport.clear()
+
+ # Send another datagram after the transfer is considered complete
+ data_datagram = DATADatagram(2, 'foobar')
+ self.ws.datagramReceived(data_datagram)
+ self.assertEqual(self.target.open('r').read(), 'foo')
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.failUnless(isinstance(err_dgram, ERRORDatagram))
+
+ # Check for proper disconnection after grace timeout expires
+ self.clock.pump((4,)*4)
+ self.failUnless(self.transport.disconnecting,
+ "We are done and the grace timeout is over, should disconnect")
+ d.addCallback(cb)
+ self.clock.advance(2)
+ return d
+
+ def test_DATA_backoff(self):
+ self.ws.block_size = 5
+
+ data_datagram = DATADatagram(1, 'foobar')
+ d = self.ws.datagramReceived(data_datagram)
+ def cb(ign):
+ self.clock.advance(0.1)
+ ack_datagram = ACKDatagram(1)
+
+ self.clock.pump((1,)*5)
+ # Sent two times - initial send and a retransmit after first timeout
+ self.assertEqual(self.transport.value(),
+ ack_datagram.to_wire()*2)
+
+ # Sent three times - initial send and two retransmits
+ self.clock.pump((1,)*4)
+ self.assertEqual(self.transport.value(),
+ ack_datagram.to_wire()*3)
+
+ # Sent still three times - initial send, two retransmits and the last wait
+ self.clock.pump((1,)*4)
+ self.assertEqual(self.transport.value(),
+ ack_datagram.to_wire()*3)
+
+ self.failUnless(self.transport.disconnecting)
+ d.addCallback(cb)
+ self.clock.advance(2.1)
+ return d
+
+ @inlineCallbacks
+ def test_failed_write(self):
+ self.writer.cancel()
+ self.ws.writer = FailingWriter()
+ data_datagram = DATADatagram(1, 'foobar')
+ yield self.ws.datagramReceived(data_datagram)
+ self.flushLoggedErrors()
+ self.clock.advance(0.1)
+ err_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.failUnless(isinstance(err_datagram, ERRORDatagram))
+ self.failUnless(self.transport.disconnecting)
+
+ def test_time_out(self):
+ data_datagram = DATADatagram(1, 'foobar')
+ d = self.ws.datagramReceived(data_datagram)
+ def cb(ign):
+ self.clock.pump((1,)*13)
+ self.failUnless(self.transport.disconnecting)
+ d.addCallback(cb)
+ self.clock.advance(4)
+ return d
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
+
+
+class ReadSessions(unittest.TestCase):
+ test_data = """line1
+line2
+anotherline"""
+ port = 65466
+
+ def setUp(self):
+ self.clock = Clock()
+ self.tmp_dir_path = tempfile.mkdtemp()
+ self.target = FilePath(self.tmp_dir_path).child('foo')
+ with self.target.open('wb') as temp_fd:
+ temp_fd.write(self.test_data)
+ self.reader = DelayedReader(self.target, _clock=self.clock, delay=2)
+ self.transport = FakeTransport(hostAddress=('127.0.0.1', self.port))
+ self.rs = ReadSession(self.reader, _clock=self.clock)
+ self.rs.transport = self.transport
+ self.rs.startProtocol()
+
+ @inlineCallbacks
+ def test_ERROR(self):
+ err_dgram = ERRORDatagram.from_code(ERR_NOT_DEFINED, 'no reason')
+ yield self.rs.datagramReceived(err_dgram)
+ self.failIf(self.transport.value())
+ self.failUnless(self.transport.disconnecting)
+
+ @inlineCallbacks
+ def test_ACK_invalid_blocknum(self):
+ ack_datagram = ACKDatagram(3)
+ yield self.rs.datagramReceived(ack_datagram)
+ self.failIf(self.transport.disconnecting)
+ err_dgram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assert_(isinstance(err_dgram, ERRORDatagram))
+ self.addCleanup(self.rs.cancel)
+
+ @inlineCallbacks
+ def test_ACK_stale_blocknum(self):
+ self.rs.blocknum = 2
+ ack_datagram = ACKDatagram(1)
+ yield self.rs.datagramReceived(ack_datagram)
+ self.failIf(self.transport.disconnecting)
+ self.failIf(self.transport.value(),
+ "Stale ACK datagram, we should not write anything back")
+ self.addCleanup(self.rs.cancel)
+
+ def test_ACK(self):
+ self.rs.block_size = 5
+ self.rs.blocknum = 1
+ ack_datagram = ACKDatagram(1)
+ d = self.rs.datagramReceived(ack_datagram)
+ def cb(ign):
+ self.clock.advance(0.1)
+ self.failIf(self.transport.disconnecting)
+ data_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.assertEqual(data_datagram.data, 'line1')
+ self.failIf(self.rs.completed,
+ "Got enough bytes from the reader, there is no reason to stop")
+ d.addCallback(cb)
+ self.clock.advance(2.5)
+ self.addCleanup(self.rs.cancel)
+ return d
+
+ def test_ACK_finished(self):
+ self.rs.block_size = 512
+ self.rs.blocknum = 1
+
+ # Send a terminating datagram
+ ack_datagram = ACKDatagram(1)
+ d = self.rs.datagramReceived(ack_datagram)
+ def cb(ign):
+ self.clock.advance(0.1)
+ ack_datagram = ACKDatagram(2)
+ # This datagram doesn't trigger any sends
+ self.rs.datagramReceived(ack_datagram)
+
+ self.assertEqual(self.transport.value(), DATADatagram(2, self.test_data).to_wire())
+ self.failUnless(self.rs.completed,
+ "Data length is less, than blocksize, time to stop")
+ self.addCleanup(self.rs.cancel)
+ d.addCallback(cb)
+ self.clock.advance(3)
+ return d
+
+ def test_ACK_backoff(self):
+ self.rs.block_size = 5
+ self.rs.blocknum = 1
+
+ ack_datagram = ACKDatagram(1)
+ d = self.rs.datagramReceived(ack_datagram)
+ def cb(ign):
+
+ self.clock.pump((1,)*4)
+ # Sent two times - initial send and a retransmit after first timeout
+ self.assertEqual(self.transport.value(),
+ DATADatagram(2, self.test_data[:5]).to_wire()*2)
+
+ # Sent three times - initial send and two retransmits
+ self.clock.pump((1,)*5)
+ self.assertEqual(self.transport.value(),
+ DATADatagram(2, self.test_data[:5]).to_wire()*3)
+
+ # Sent still three times - initial send, two retransmits and the last wait
+ self.clock.pump((1,)*10)
+ self.assertEqual(self.transport.value(),
+ DATADatagram(2, self.test_data[:5]).to_wire()*3)
+
+ self.failUnless(self.transport.disconnecting)
+ d.addCallback(cb)
+ self.clock.advance(2.5)
+ return d
+
+ @inlineCallbacks
+ def test_failed_read(self):
+ self.reader.finish()
+ self.rs.reader = FailingReader()
+ self.rs.blocknum = 1
+ ack_datagram = ACKDatagram(1)
+ yield self.rs.datagramReceived(ack_datagram)
+ self.flushLoggedErrors()
+ self.clock.advance(0.1)
+ err_datagram = TFTPDatagramFactory(*split_opcode(self.transport.value()))
+ self.failUnless(isinstance(err_datagram, ERRORDatagram))
+ self.failUnless(self.transport.disconnecting)
+
+ def tearDown(self):
+ shutil.rmtree(self.tmp_dir_path)
=== added file 'contrib/python-tx-tftp/tftp/test/test_util.py'
--- contrib/python-tx-tftp/tftp/test/test_util.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_util.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,68 @@
+'''
+@author: shylent
+'''
+from tftp.util import SequentialCall, Spent, Cancelled
+from twisted.internet.task import Clock
+from twisted.trial import unittest
+
+
+class CallCounter(object):
+ call_num = 0
+
+ def __call__(self):
+ self.call_num += 1
+
+
+class SequentialCalling(unittest.TestCase):
+
+ def setUp(self):
+ self.f = CallCounter()
+ self.t = CallCounter()
+ self.clock = Clock()
+
+ def test_empty(self):
+ SequentialCall.run((), self.f, on_timeout=self.t, _clock=self.clock)
+ self.clock.pump((1,))
+ self.assertEqual(self.f.call_num, 0)
+ self.assertEqual(self.t.call_num, 1)
+
+ def test_empty_now(self):
+ SequentialCall.run((), self.f, on_timeout=self.t, run_now=True, _clock=self.clock)
+ self.clock.pump((1,))
+ self.assertEqual(self.f.call_num, 1)
+ self.assertEqual(self.t.call_num, 1)
+
+ def test_non_empty(self):
+ c = SequentialCall.run((1, 3, 5), self.f, run_now=True, on_timeout=self.t, _clock=self.clock)
+ self.clock.advance(0.1)
+ self.failUnless(c.active())
+ self.assertEqual(self.f.call_num, 1)
+ self.clock.pump((1,)*2)
+ self.failUnless(c.active())
+ self.assertEqual(self.f.call_num, 2)
+ self.clock.pump((1,)*3)
+ self.failUnless(c.active())
+ self.assertEqual(self.f.call_num, 3)
+ self.clock.pump((1,)*5)
+ self.failIf(c.active())
+ self.assertEqual(self.f.call_num, 4)
+ self.assertEqual(self.t.call_num, 1)
+ self.assertRaises(Spent, c.reschedule)
+ self.assertRaises(Spent, c.cancel)
+
+ def test_cancel(self):
+ c = SequentialCall.run((1, 3, 5), self.f, on_timeout=self.t, _clock=self.clock)
+ self.clock.pump((1,)*2)
+ self.assertEqual(self.f.call_num, 1)
+ c.cancel()
+ self.assertRaises(Cancelled, c.cancel)
+ self.assertEqual(self.t.call_num, 0)
+ self.assertRaises(Cancelled, c.reschedule)
+
+ def test_cancel_immediately(self):
+ c = SequentialCall.run((1, 3, 5), lambda: c.cancel(), run_now=True,
+ on_timeout=self.t, _clock=self.clock)
+ self.clock.pump((1,)*2)
+ self.assertRaises(Cancelled, c.cancel)
+ self.assertEqual(self.t.call_num, 0)
+ self.assertRaises(Cancelled, c.reschedule)
=== added file 'contrib/python-tx-tftp/tftp/test/test_wire_protocol.py'
--- contrib/python-tx-tftp/tftp/test/test_wire_protocol.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/test/test_wire_protocol.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,143 @@
+'''
+@author: shylent
+'''
+from tftp.datagram import (split_opcode, WireProtocolError, TFTPDatagramFactory,
+ RQDatagram, DATADatagram, ACKDatagram, ERRORDatagram, errors, OP_RRQ, OP_WRQ,
+ OACKDatagram)
+from tftp.errors import OptionsDecodeError
+from twisted.trial import unittest
+
+
+class OpcodeProcessing(unittest.TestCase):
+
+ def test_zero_length(self):
+ self.assertRaises(WireProtocolError, split_opcode, '')
+
+ def test_incomplete_opcode(self):
+ self.assertRaises(WireProtocolError, split_opcode, '0')
+
+ def test_empty_payload(self):
+ self.assertEqual(split_opcode('\x00\x01'), (1, ''))
+
+ def test_non_empty_payload(self):
+ self.assertEqual(split_opcode('\x00\x01foo'), (1, 'foo'))
+
+ def test_unknown_opcode(self):
+ opcode = 17
+ self.assertRaises(WireProtocolError, TFTPDatagramFactory, opcode, 'foobar')
+
+
+class ConcreteDatagrams(unittest.TestCase):
+
+ def test_rq(self):
+ # Only one field - not ok
+ self.assertRaises(WireProtocolError, RQDatagram.from_wire, 'foobar')
+ # Two fields - ok (unterminated, slight deviation from the spec)
+ dgram = RQDatagram.from_wire('foo\x00bar')
+ dgram.opcode = OP_RRQ
+ self.assertEqual(dgram.to_wire(), '\x00\x01foo\x00bar\x00')
+ # Two fields terminated is ok too
+ RQDatagram.from_wire('foo\x00bar\x00')
+ dgram.opcode = OP_RRQ
+ self.assertEqual(dgram.to_wire(), '\x00\x01foo\x00bar\x00')
+ # More than two fields is also ok (unterminated, slight deviation from the spec)
+ dgram = RQDatagram.from_wire('foo\x00bar\x00baz\x00spam')
+ self.assertEqual(dgram.options, {'baz':'spam'})
+ dgram.opcode = OP_WRQ
+ self.assertEqual(dgram.to_wire(), '\x00\x02foo\x00bar\x00baz\x00spam\x00')
+ # More than two fields is also ok (terminated)
+ dgram = RQDatagram.from_wire('foo\x00bar\x00baz\x00spam\x00one\x00two\x00')
+ self.assertEqual(dgram.options, {'baz':'spam', 'one':'two'})
+ dgram.opcode = OP_RRQ
+ self.assertEqual(dgram.to_wire(),
+ '\x00\x01foo\x00bar\x00baz\x00spam\x00one\x00two\x00')
+ # Option with no value - not ok
+ self.assertRaises(OptionsDecodeError,
+ RQDatagram.from_wire, 'foo\x00bar\x00baz\x00spam\x00one\x00')
+ # Duplicate option - not ok
+ self.assertRaises(OptionsDecodeError,
+ RQDatagram.from_wire,
+ 'foo\x00bar\x00baz\x00spam\x00one\x00two\x00baz\x00val\x00')
+
+ def test_rrq(self):
+ self.assertEqual(TFTPDatagramFactory(*split_opcode('\x00\x01foo\x00bar')).to_wire(),
+ '\x00\x01foo\x00bar\x00')
+
+ def test_wrq(self):
+ self.assertEqual(TFTPDatagramFactory(*split_opcode('\x00\x02foo\x00bar')).to_wire(),
+ '\x00\x02foo\x00bar\x00')
+
+ def test_oack(self):
+ # Zero options (I don't know if it is ok, the standard doesn't say anything)
+ dgram = OACKDatagram.from_wire('')
+ self.assertEqual(dgram.to_wire(), '\x00\x06')
+ # One option, terminated
+ dgram = OACKDatagram.from_wire('foo\x00bar\x00')
+ self.assertEqual(dgram.options, {'foo':'bar'})
+ self.assertEqual(dgram.to_wire(), '\x00\x06foo\x00bar\x00')
+ # Not terminated
+ dgram = OACKDatagram.from_wire('foo\x00bar\x00baz\x00spam')
+ self.assertEqual(dgram.options, {'foo':'bar', 'baz':'spam'})
+ self.assertEqual(dgram.to_wire(), '\x00\x06foo\x00bar\x00baz\x00spam\x00')
+ # Option with no value
+ self.assertRaises(OptionsDecodeError, OACKDatagram.from_wire,
+ 'foo\x00bar\x00baz')
+ # Duplicate option
+ self.assertRaises(OptionsDecodeError,
+ OACKDatagram.from_wire,
+ 'baz\x00spam\x00one\x00two\x00baz\x00val\x00')
+
+ def test_data(self):
+ # Zero-length payload
+ self.assertRaises(WireProtocolError, DATADatagram.from_wire, '')
+ # One byte payload
+ self.assertRaises(WireProtocolError, DATADatagram.from_wire, '\x00')
+ # Zero-length data
+ self.assertEqual(DATADatagram.from_wire('\x00\x01').to_wire(),
+ '\x00\x03\x00\x01')
+ # Full-length data
+ self.assertEqual(DATADatagram.from_wire('\x00\x01foobar').to_wire(),
+ '\x00\x03\x00\x01foobar')
+
+ def test_ack(self):
+ # Zero-length payload
+ self.assertRaises(WireProtocolError, ACKDatagram.from_wire, '')
+ # One byte payload
+ self.assertRaises(WireProtocolError, ACKDatagram.from_wire, '\x00')
+ # Full-length payload
+ self.assertEqual(ACKDatagram.from_wire('\x00\x0a').blocknum, 10)
+ self.assertEqual(ACKDatagram.from_wire('\x00\x0a').to_wire(), '\x00\x04\x00\x0a')
+ # Extra data in payload
+ self.assertRaises(WireProtocolError, ACKDatagram.from_wire, '\x00\x10foobarz')
+
+ def test_error(self):
+ # Zero-length payload
+ self.assertRaises(WireProtocolError, ERRORDatagram.from_wire, '')
+ # One byte payload
+ self.assertRaises(WireProtocolError, ERRORDatagram.from_wire, '\x00')
+ # Errorcode only (maybe this should fail)
+ dgram = ERRORDatagram.from_wire('\x00\x01')
+ self.assertEqual(dgram.errorcode, 1)
+ self.assertEqual(dgram.errmsg, errors[1])
+ # Errorcode with errstring - not terminated
+ dgram = ERRORDatagram.from_wire('\x00\x01foobar')
+ self.assertEqual(dgram.errorcode, 1)
+ self.assertEqual(dgram.errmsg, 'foobar')
+ # Errorcode with errstring - terminated
+ dgram = ERRORDatagram.from_wire('\x00\x01foobar\x00')
+ self.assertEqual(dgram.errorcode, 1)
+ self.assertEqual(dgram.errmsg, 'foobar')
+ # Unknown errorcode
+ self.assertRaises(WireProtocolError, ERRORDatagram.from_wire, '\x00\x0efoobar')
+ # Unknown errorcode in from_code
+ self.assertRaises(WireProtocolError, ERRORDatagram.from_code, 13)
+ # from_code with custom message
+ dgram = ERRORDatagram.from_code(3, "I've accidentally the whole message")
+ self.assertEqual(dgram.errorcode, 3)
+ self.assertEqual(dgram.errmsg, "I've accidentally the whole message")
+ self.assertEqual(dgram.to_wire(), "\x00\x05\x00\x03I've accidentally the whole message\x00")
+ # from_code default message
+ dgram = ERRORDatagram.from_code(3)
+ self.assertEqual(dgram.errorcode, 3)
+ self.assertEqual(dgram.errmsg, "Disk full or allocation exceeded")
+ self.assertEqual(dgram.to_wire(), "\x00\x05\x00\x03Disk full or allocation exceeded\x00")
=== added file 'contrib/python-tx-tftp/tftp/util.py'
--- contrib/python-tx-tftp/tftp/util.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/tftp/util.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,136 @@
+'''
+@author: shylent
+'''
+from functools import wraps
+from twisted.internet import reactor
+from twisted.internet.defer import maybeDeferred
+
+
+__all__ = ['SequentialCall', 'Spent', 'Cancelled', 'deferred']
+
+
+class Spent(Exception):
+ """Trying to iterate a L{SequentialCall}, that is exhausted"""
+
+class Cancelled(Exception):
+ """Trying to iterate a L{SequentialCall}, that's been cancelled"""
+
+def no_op(*args, **kwargs):
+ pass
+
+class SequentialCall(object):
+ """Calls a given callable at intervals, specified by the L{timeout} iterable.
+ Optionally calls a timeout handler, if provided, when there are no more timeout values.
+
+ @param timeout: an iterable, that yields valid _seconds arguments to
+ L{callLater<twisted.internet.interfaces.IReactorTime.callLater>} (floats)
+ @type timeout: any iterable
+
+ @param run_now: whether or not the callable should be called immediately
+ upon initialization. Relinquishes control to the reactor
+ (calls callLater(0,...)). Default: C{False}.
+ @type run_now: C{bool}
+
+ @param callable: the callable, that will be called at the specified intervals
+ @param callable_args: the arguments to call it with
+ @param callable_kwargs: the keyword arguments to call it with
+
+ @param on_timeout: the callable, that will be called when there are no more
+ timeout values
+ @param on_timeout_args: the arguments to call it with
+ @param on_timeout_kwargs: the keyword arguments to call it with
+
+ """
+
+ @classmethod
+ def run(cls, timeout, callable, callable_args=None, callable_kwargs=None,
+ on_timeout=None, on_timeout_args=None, on_timeout_kwargs=None,
+ run_now=False, _clock=None):
+ """Create a L{SequentialCall} object and start its scheduler cycle
+
+ @see: L{SequentialCall}
+
+ """
+ inst = cls(timeout, callable, callable_args, callable_kwargs,
+ on_timeout, on_timeout_args, on_timeout_kwargs,
+ run_now, _clock)
+ inst.reschedule()
+ return inst
+
+ def __init__(self, timeout,
+ callable, callable_args=None, callable_kwargs=None,
+ on_timeout=None, on_timeout_args=None, on_timeout_kwargs=None,
+ run_now=False, _clock=None):
+ self._timeout = iter(timeout)
+ self.callable = callable
+ self.callable_args = callable_args or []
+ self.callable_kwargs = callable_kwargs or {}
+ self.on_timeout = on_timeout or no_op
+ self.on_timeout_args = on_timeout_args or []
+ self.on_timeout_kwargs = on_timeout_kwargs or {}
+ self._wd = None
+ self._spent = self._cancelled = False
+ self._ran_first = not run_now
+ if _clock is None:
+ self._clock = reactor
+ else:
+ self._clock = _clock
+
+ def _call_and_schedule(self):
+ self.callable(*self.callable_args, **self.callable_kwargs)
+ self._ran_first = True
+ if not self._spent:
+ self.reschedule()
+
+ def reschedule(self):
+ """Schedule the next L{callable} call
+
+ @raise Spent: if the timeout iterator has been exhausted and on_timeout
+ handler has been already called
+ @raise Cancelled: if this L{SequentialCall} has already been cancelled
+
+ """
+ if not self._ran_first:
+ self._wd = self._clock.callLater(0, self._call_and_schedule)
+ return
+ if self._cancelled:
+ raise Cancelled("This SequentialCall has already been cancelled")
+ if self._spent:
+ raise Spent("This SequentialCall has already timed out")
+ try:
+ next_timeout = self._timeout.next()
+ self._wd = self._clock.callLater(next_timeout, self._call_and_schedule)
+ except StopIteration:
+ self.on_timeout(*self.on_timeout_args, **self.on_timeout_kwargs)
+ self._spent = True
+
+ def cancel(self):
+ """Cancel the next scheduled call
+
+ @raise Cancelled: if this SequentialCall has already been cancelled
+ @raise Spent: if this SequentialCall has expired
+
+ """
+ if self._cancelled:
+ raise Cancelled("This SequentialCall has already been cancelled")
+ if self._spent:
+ raise Spent("This SequentialCall has already timed out")
+ if self._wd is not None and self._wd.active():
+ self._wd.cancel()
+ self._spent = self._cancelled = True
+
+ def active(self):
+ """Whether or not this L{SequentialCall} object is considered active"""
+ return not (self._spent or self._cancelled)
+
+
+def deferred(func):
+ """Decorates a function to ensure that it always returns a `Deferred`.
+
+ This also serves a secondary documentation purpose; functions decorated
+ with this are readily identifiable as asynchronous.
+ """
+ @wraps(func)
+ def wrapper(*args, **kwargs):
+ return maybeDeferred(func, *args, **kwargs)
+ return wrapper
=== added directory 'contrib/python-tx-tftp/twisted'
=== added directory 'contrib/python-tx-tftp/twisted/plugins'
=== added file 'contrib/python-tx-tftp/twisted/plugins/tftp_plugin.py'
--- contrib/python-tx-tftp/twisted/plugins/tftp_plugin.py 1970-01-01 00:00:00 +0000
+++ contrib/python-tx-tftp/twisted/plugins/tftp_plugin.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,45 @@
+'''
+@author: shylent
+'''
+from tftp.backend import FilesystemSynchronousBackend
+from tftp.protocol import TFTP
+from twisted.application import internet
+from twisted.application.service import IServiceMaker
+from twisted.plugin import IPlugin
+from twisted.python import usage
+from twisted.python.filepath import FilePath
+from zope.interface import implements
+
+
+def to_path(str_path):
+ return FilePath(str_path)
+
+class TFTPOptions(usage.Options):
+ optFlags = [
+ ['enable-reading', 'r', 'Lets the clients read from this server.'],
+ ['enable-writing', 'w', 'Lets the clients write to this server.'],
+ ['verbose', 'v', 'Make this server noisy.']
+ ]
+ optParameters = [
+ ['port', 'p', 1069, 'Port number to listen on.', int],
+ ['root-directory', 'd', None, 'Root directory for this server.', to_path]
+ ]
+
+ def postOptions(self):
+ if self['root-directory'] is None:
+ raise usage.UsageError("You must provide a root directory for the server")
+
+
+class TFTPServiceCreator(object):
+ implements(IServiceMaker, IPlugin)
+ tapname = "tftp"
+ description = "A TFTP Server"
+ options = TFTPOptions
+
+ def makeService(self, options):
+ backend = FilesystemSynchronousBackend(options["root-directory"],
+ can_read=options['enable-reading'],
+ can_write=options['enable-writing'])
+ return internet.UDPServer(options['port'], TFTP(backend))
+
+serviceMaker = TFTPServiceCreator()
=== added file 'contrib/tgt.conf'
--- contrib/tgt.conf 1970-01-01 00:00:00 +0000
+++ contrib/tgt.conf 2013-10-09 20:38:29 +0000
@@ -0,0 +1,1 @@
+include /var/lib/maas/ephemeral/tgt.conf.d/*.conf
=== added file 'contrib/wsgi.py'
--- contrib/wsgi.py 1970-01-01 00:00:00 +0000
+++ contrib/wsgi.py 2013-10-09 20:38:29 +0000
@@ -0,0 +1,32 @@
+# Copyright 2012 Canonical Ltd. This software is licensed under the
+# GNU Affero General Public License version 3 (see the file LICENSE).
+
+"""WSGI Application."""
+
+from __future__ import (
+ absolute_import,
+ print_function,
+ unicode_literals,
+ )
+
+str = None
+
+__metaclass__ = type
+__all__ = [
+ 'application',
+ ]
+
+import os
+import sys
+
+import django.core.handlers.wsgi
+
+
+current_path = os.path.dirname(os.path.abspath(__file__))
+sys.path.append(current_path)
+
+os.environ['DJANGO_SETTINGS_MODULE'] = 'maas.settings'
+application = django.core.handlers.wsgi.WSGIHandler()
+
+from maasserver.start_up import start_up
+start_up()
=== added directory 'docs'
=== added directory 'docs/_static'
=== added directory 'docs/_templates'
=== added directory 'docs/_templates/autosummary'
=== added file 'docs/_templates/autosummary/module.rst'
--- docs/_templates/autosummary/module.rst 1970-01-01 00:00:00 +0000
+++ docs/_templates/autosummary/module.rst 2013-10-09 20:38:29 +0000
@@ -0,0 +1,8 @@
+..
+ Override autosummary's module.rst in Sphinx 1.1.3; does not respect
+ __all__. See https://bitbucket.org/birkenfeld/sphinx/issue/317
+
+{{ fullname }}
+{{ underline }}
+
+.. automodule:: {{ fullname }}
=== added directory 'docs/_templates/ubuntu1210'
=== added file 'docs/_templates/ubuntu1210/globaltoc.html'
--- docs/_templates/ubuntu1210/globaltoc.html 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/globaltoc.html 2013-10-09 20:38:29 +0000
@@ -0,0 +1,4 @@
+<li class="dropdown">
+ <a href="{{ pathto(master_doc) }}" class="dropdown-toggle" data-toggle="dropdown">{{ _('Table of Contents') }} <i class="icon-chevron-down"></i></a>
+ <ul class="dropdown-menu globaltoc">{{ toctree(maxdepth=1) }}</ul>
+</li>
=== added file 'docs/_templates/ubuntu1210/layout.html'
--- docs/_templates/ubuntu1210/layout.html 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/layout.html 2013-10-09 20:38:29 +0000
@@ -0,0 +1,103 @@
+{% set script_files = script_files + ['_static/js/bootstrap.js', '_static/ubuntu1204.js', '_static/lib/prettyprint/prettyprint.js', 'https://html5shim.googlecode.com/svn/trunk/html5.js'] %}
+{% set css_files = ['_static/ubuntu1204-core.css', '_static/ubuntu1204-sphinx.css', '_static/lib/font/font-awesome.css','_static/lib/prettyprint/prettyprint.css', '_static/lib/bootstrap.min.css'] %}
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ {{ metatags }}
+ <title>{{ title|striptags|e }}{{ titlesuffix }}</title>
+ {%- for cssfile in css_files %}
+ <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" />
+ {%- endfor %}
+ {%- if use_opensearch %}
+ <link rel="search" type="application/opensearchdescription+xml"
+ title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}"
+ href="{{ pathto('_static/opensearch.xml', 1) }}"/>
+ {%- endif %}
+ <link rel="shortcut icon" href="{{ pathto('_static/images/favicon.ico', 1) }}"/>
+ <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" />
+ <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" />
+ <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" />
+ <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" />
+ <script type="text/javascript">
+ var DOCUMENTATION_OPTIONS = {
+ URL_ROOT: '{{ url_root }}',
+ VERSION: '{{ release|e }}',
+ COLLAPSE_INDEX: false,
+ FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
+ HAS_SOURCE: {{ has_source|lower }}
+ };
+ WebFontConfig = {
+ google: { families: [ 'Ubuntu' ] }
+ };
+ </script>
+ {%- for scriptfile in script_files %}
+ <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
+ {%- endfor %}
+ <script type="text/javascript" src="https://use.typekit.com/vkx8olt.js"></script>
+ <script type="text/javascript">try{Typekit.load();}catch(e){}</script>
+ </head>
+ <body onload="prettyPrint();">
+<div class="container" style="border-left: 1px solid #ddd;border-right: 1px solid #ddd;height:100%;">
+<header>
+ <nav role="navigation" class="nav-primary">
+ <ul class="clearfix">
+
+ </ul>
+ </nav>
+ <a class="logo-ubuntu" href="{{ pathto(master_doc) }}"><img height="27" src="{{ pathto('_static/images/header_logo.png',1) }}" alt="Ubuntu logo"/></a>
+</header>
+<div class="row-fluid">
+<div class="span12" style="padding-right: 10px;padding-left: 10px;">
+<nav role="navigation" class="nav-secondary">
+<ul class="clearfix">
+</ul>
+</nav>
+</div>
+</div>
+<div class="row-fluid">
+<div class="span3">
+<div class="well sidebar-nav">
+<ul class="nav nav-list">
+<li class="nav-header">{{ _('Table of Contents') }}</li>
+{{ toctree() }}
+</ul>
+</div>
+</div>
+<div class="span9" style="padding-right: 10px;padding-left: 5px;">
+{%- block content %}
+ {% block body %} {% endblock %}
+{%- endblock %}
+</div>
+</div>
+
+<footer class="clear">
+<p><br/>
+{% trans copyright=copyright|e %}© Copyright {{ copyright }}. Documentation Source Licensed GPLv3.{% endtrans %}
+<br />
+{% trans last_updated=last_updated|e %} Last Generated on {{ last_updated }}.{% endtrans %}
+{% trans sphinx_version=sphinx_version|e %} Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %}<br/>
+{% if meta %}
+{% if meta['version'] %}
+Document Version {{ meta['version'] }}
+{% endif %}
+{% if meta['authors'] %}
+Authored by {{ meta['authors'] | join(', ') }}
+{% endif %}
+{% if meta['date'] %}
+ {{ meta['date'] }}.
+{% endif %}
+{% if meta['version'] or meta['author'] or meta['date'] %}
+<br />
+{% endif %}
+{% endif %}
+.</p>
+<a class="logo-ubuntu" href="//www.ubuntu.com/">
+<img width="118" height="27" src="{{ pathto('_static/images/logo-footer.png',1) }}" alt="Ubuntu logo"/>
+</a>
+</footer>
+</div>
+</div>
+</body>
+</html>
=== added file 'docs/_templates/ubuntu1210/sourcelink.html'
--- docs/_templates/ubuntu1210/sourcelink.html 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/sourcelink.html 2013-10-09 20:38:29 +0000
@@ -0,0 +1,4 @@
+{%- if show_source and has_source and sourcename %}
+ <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+ rel="nofollow">{{ _('Source') }}</a></li>
+{%- endif %}
=== added directory 'docs/_templates/ubuntu1210/static'
=== added directory 'docs/_templates/ubuntu1210/static/images'
=== added file 'docs/_templates/ubuntu1210/static/images/H3_arrow.png'
Binary files docs/_templates/ubuntu1210/static/images/H3_arrow.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/H3_arrow.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/bg_dotted.png'
Binary files docs/_templates/ubuntu1210/static/images/bg_dotted.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/bg_dotted.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/community.png'
Binary files docs/_templates/ubuntu1210/static/images/community.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/community.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/content_bg.png'
Binary files docs/_templates/ubuntu1210/static/images/content_bg.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/content_bg.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/devops.png'
Binary files docs/_templates/ubuntu1210/static/images/devops.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/devops.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/easy.png'
Binary files docs/_templates/ubuntu1210/static/images/easy.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/easy.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/education.png'
Binary files docs/_templates/ubuntu1210/static/images/education.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/education.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/header_bg.png'
Binary files docs/_templates/ubuntu1210/static/images/header_bg.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/header_bg.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/header_logo.png'
Binary files docs/_templates/ubuntu1210/static/images/header_logo.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/header_logo.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/logo-footer.png'
Binary files docs/_templates/ubuntu1210/static/images/logo-footer.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/logo-footer.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/orchestration.png'
Binary files docs/_templates/ubuntu1210/static/images/orchestration.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/orchestration.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/overlay-bg.png'
Binary files docs/_templates/ubuntu1210/static/images/overlay-bg.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/overlay-bg.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/search_submit_bg_2.png'
Binary files docs/_templates/ubuntu1210/static/images/search_submit_bg_2.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/search_submit_bg_2.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/subnav_active_bg.png'
Binary files docs/_templates/ubuntu1210/static/images/subnav_active_bg.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/subnav_active_bg.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/topnav_divider.png'
Binary files docs/_templates/ubuntu1210/static/images/topnav_divider.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/topnav_divider.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/images/wrapper_bottom_bg.png'
Binary files docs/_templates/ubuntu1210/static/images/wrapper_bottom_bg.png 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/images/wrapper_bottom_bg.png 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/jquery.js'
--- docs/_templates/ubuntu1210/static/jquery.js 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/static/jquery.js 2013-10-09 20:38:29 +0000
@@ -0,0 +1,4 @@
+/*! jQuery v1.7.2 jquery.com | jquery.org/license */
+(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"<!doctype html>":"")+"<html><body>"),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function ca(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function b_(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bD.test(a)?d(a,e):b_(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&f.type(b)==="object")for(var e in b)b_(a+"["+e+"]",b[e],c,d);else d(a,b)}function b$(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function bZ(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bS,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=bZ(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=bZ(a,c,d,e,"*",g));return l}function bY(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bO),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bB(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?1:0,g=4;if(d>0){if(c!=="border")for(;e<g;e+=2)c||(d-=parseFloat(f.css(a,"padding"+bx[e]))||0),c==="margin"?d+=parseFloat(f.css(a,c+bx[e]))||0:d-=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0;return d+"px"}d=by(a,b);if(d<0||d==null)d=a.style[b];if(bt.test(d))return d;d=parseFloat(d)||0;if(c)for(;e<g;e+=2)d+=parseFloat(f.css(a,"padding"+bx[e]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+bx[e]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+bx[e]))||0);return d+"px"}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;b.nodeType===1&&(b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase(),c==="object"?b.outerHTML=a.outerHTML:c!=="input"||a.type!=="checkbox"&&a.type!=="radio"?c==="option"?b.selected=a.defaultSelected:c==="input"||c==="textarea"?b.defaultValue=a.defaultValue:c==="script"&&b.text!==a.text&&(b.text=a.text):(a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value)),b.removeAttribute(f.expando),b.removeAttribute("_submit_attached"),b.removeAttribute("_change_attached"))}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c,i[c][d])}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h,i){var j,k=d==null,l=0,m=a.length;if(d&&typeof d=="object"){for(l in d)e.access(a,c,l,d[l],1,h,f);g=1}else if(f!==b){j=i===b&&e.isFunction(f),k&&(j?(j=c,c=function(a,b,c){return j.call(e(a),c)}):(c.call(a,f),c=null));if(c)for(;l<m;l++)c(a[l],d,j?f.call(a[l],l,c(a[l],d)):f,i);g=1}return g?a:k?c.call(a):m?c(a[0],d):h},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m,n=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?n(g):h==="function"&&(!a.unique||!p.has(g))&&c.push(g)},o=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,j=!0,m=k||0,k=0,l=c.length;for(;c&&m<l;m++)if(c[m].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}j=!1,c&&(a.once?e===!0?p.disable():c=[]:d&&d.length&&(e=d.shift(),p.fireWith(e[0],e[1])))},p={add:function(){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){j&&f<=l&&(l--,f<=m&&m--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&p.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(j?a.once||d.push([b,c]):(!a.once||!e)&&o(b,c));return this},fire:function(){p.fireWith(this,arguments);return this},fired:function(){return!!i}};return p};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p=c.createElement("div"),q=c.documentElement;p.setAttribute("className","t"),p.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="<div "+n+"display:block;'><div style='"+t+"0;display:block;overflow:hidden;'></div></div>"+"<table "+n+"' cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="<table><tr><td style='"+t+"0;display:none'></td><td>t</td></tr></table>",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="<div style='width:5px;'></div>",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h,i,j=this[0],k=0,m=null;if(a===b){if(this.length){m=f.data(j);if(j.nodeType===1&&!f._data(j,"parsedAttrs")){g=j.attributes;for(i=g.length;k<i;k++)h=g[k].name,h.indexOf("data-")===0&&(h=f.camelCase(h.substring(5)),l(j,h,m[h]));f._data(j,"parsedAttrs",!0)}}return m}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split(".",2),d[1]=d[1]?"."+d[1]:"",e=d[1]+"!";return f.access(this,function(c){if(c===b){m=this.triggerHandler("getData"+e,[d[0]]),m===b&&j&&(m=f.data(j,a),m=l(j,a,m));return m===b&&d[1]?this.data(d[0]):m}d[1]=c,this.each(function(){var b=f(this);b.triggerHandler("setData"+e,d),f.data(this,a,c),b.triggerHandler("changeData"+e,d)})},null,c,arguments.length>1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length<d)return f.queue(this[0],a);return c===b?this:this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise(c)}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,f.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i<g;i++)e=d[i],e&&(c=f.propFix[e]||e,h=u.test(e),h||f.attr(a,e,""),a.removeAttribute(v?e:c),h&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0,coords:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(
+a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:g&&G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=f.event.special[c.type]||{},j=[],k,l,m,n,o,p,q,r,s,t,u;g[0]=c,c.delegateTarget=this;if(!i.preDispatch||i.preDispatch.call(this,c)!==!1){if(e&&(!c.button||c.type!=="click")){n=f(this),n.context=this.ownerDocument||this;for(m=c.target;m!=this;m=m.parentNode||this)if(m.disabled!==!0){p={},r=[],n[0]=m;for(k=0;k<e;k++)s=d[k],t=s.selector,p[t]===b&&(p[t]=s.quick?H(m,s.quick):n.is(t)),p[t]&&r.push(s);r.length&&j.push({elem:m,matches:r})}}d.length>e&&j.push({elem:this,matches:d.slice(e)});for(k=0;k<j.length&&!c.isPropagationStopped();k++){q=j[k],c.currentTarget=q.elem;for(l=0;l<q.matches.length&&!c.isImmediatePropagationStopped();l++){s=q.matches[l];if(h||!c.namespace&&!s.namespace||c.namespace_re&&c.namespace_re.test(s.namespace))c.data=s.data,c.handleObj=s,o=((f.event.special[s.origType]||{}).handle||s.handler).apply(q.elem,g),o!==b&&(c.result=o,o===!1&&(c.preventDefault(),c.stopPropagation()))}}i.postDispatch&&i.postDispatch.call(this,c);return c.result}},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){a._submit_bubble=!0}),d._submit_attached=!0)})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=d||c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.origType+"."+e.namespace:e.origType,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9||d===11){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.globalPOS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")[\\s/>]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f
+.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(;d<e;d++)c=this[d]||{},c.nodeType===1&&(f.cleanData(c.getElementsByTagName("*")),c.innerHTML=a);c=0}catch(g){}}c&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,function(a,b){b.src?f.ajax({type:"GET",global:!1,url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)})}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1></$2>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]==="<table>"&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i<u;i++)bn(l[i]);else bn(l);l.nodeType?j.push(l):j=f.merge(j,l)}if(d){g=function(a){return!a.type||be.test(a.type)};for(k=0;j[k];k++){h=j[k];if(e&&f.nodeName(h,"script")&&(!h.type||be.test(h.type)))e.push(h.parentNode?h.parentNode.removeChild(h):h);else{if(h.nodeType===1){var v=f.grep(h.getElementsByTagName("script"),g);j.splice.apply(j,[k+1,0].concat(v))}d.appendChild(h)}}}return j},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bp=/alpha\([^)]*\)/i,bq=/opacity=([^)]*)/,br=/([A-Z]|^ms)/g,bs=/^[\-+]?(?:\d*\.)?\d+$/i,bt=/^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,bu=/^([\-+])=([\-+.\de]+)/,bv=/^margin/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Top","Right","Bottom","Left"],by,bz,bA;f.fn.css=function(a,c){return f.access(this,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)},a,c,arguments.length>1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),(e===""&&f.css(d,"display")==="none"||!f.contains(d.ownerDocument.documentElement,d))&&f._data(d,"olddisplay",cu(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(ct("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(ct("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o,p,q;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]);if((k=f.cssHooks[g])&&"expand"in k){l=k.expand(a[g]),delete a[g];for(i in l)i in a||(a[i]=l[i])}}for(g in a){h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cu(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cm.test(h)?(q=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),q?(f._data(this,"toggle"+i,q==="show"?"hide":"show"),j[q]()):j[h]()):(m=cn.exec(h),n=j.cur(),m?(o=parseFloat(m[2]),p=m[3]||(f.cssNumber[i]?"":"px"),p!=="px"&&(f.style(this,i,(o||1)+p),n=(o||1)/j.cur()*n,f.style(this,i,n+p)),m[1]&&(o=(m[1]==="-="?-1:1)*o+n),j.custom(n,o,p)):j.custom(n,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:ct("show",1),slideUp:ct("hide",1),slideToggle:ct("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a){return a},swing:function(a){return-Math.cos(a*Math.PI)/2+.5}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cq||cr(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){f._data(e.elem,"fxshow"+e.prop)===b&&(e.options.hide?f._data(e.elem,"fxshow"+e.prop,e.start):e.options.show&&f._data(e.elem,"fxshow"+e.prop,e.end))},h()&&f.timers.push(h)&&!co&&(co=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cq||cr(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(co),co=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(cp.concat.apply([],cp),function(a,b){b.indexOf("margin")&&(f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)})}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cv,cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?cv=function(a,b,c,d){try{d=a.getBoundingClientRect()}catch(e){}if(!d||!f.contains(c,a))return d?{top:d.top,left:d.left}:{top:0,left:0};var g=b.body,h=cy(b),i=c.clientTop||g.clientTop||0,j=c.clientLeft||g.clientLeft||0,k=h.pageYOffset||f.support.boxModel&&c.scrollTop||g.scrollTop,l=h.pageXOffset||f.support.boxModel&&c.scrollLeft||g.scrollLeft,m=d.top+k-i,n=d.left+l-j;return{top:m,left:n}}:cv=function(a,b,c){var d,e=a.offsetParent,g=a,h=b.body,i=b.defaultView,j=i?i.getComputedStyle(a,null):a.currentStyle,k=a.offsetTop,l=a.offsetLeft;while((a=a.parentNode)&&a!==h&&a!==c){if(f.support.fixedPosition&&j.position==="fixed")break;d=i?i.getComputedStyle(a,null):a.currentStyle,k-=a.scrollTop,l-=a.scrollLeft,a===e&&(k+=a.offsetTop,l+=a.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(a.nodeName))&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),g=e,e=a.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&d.overflow!=="visible"&&(k+=parseFloat(d.borderTopWidth)||0,l+=parseFloat(d.borderLeftWidth)||0),j=d}if(j.position==="relative"||j.position==="static")k+=h.offsetTop,l+=h.offsetLeft;f.support.fixedPosition&&j.position==="fixed"&&(k+=Math.max(c.scrollTop,h.scrollTop),l+=Math.max(c.scrollLeft,h.scrollLeft));return{top:k,left:l}},f.fn.offset=function(a){if(arguments.length)return a===b?this:this.each(function(b){f.offset.setOffset(this,a,b)});var c=this[0],d=c&&c.ownerDocument;if(!d)return null;if(c===d.body)return f.offset.bodyOffset(c);return cv(c,d,d.documentElement)},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
\ No newline at end of file
=== added directory 'docs/_templates/ubuntu1210/static/js'
=== added file 'docs/_templates/ubuntu1210/static/js/bootstrap.js'
--- docs/_templates/ubuntu1210/static/js/bootstrap.js 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/static/js/bootstrap.js 2013-10-09 20:38:29 +0000
@@ -0,0 +1,1836 @@
+/* ===================================================
+ * bootstrap-transition.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#transitions
+ * ===================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ $(function () {
+
+ "use strict"; // jshint ;_;
+
+
+ /* CSS TRANSITION SUPPORT (http://www.modernizr.com/)
+ * ======================================================= */
+
+ $.support.transition = (function () {
+
+ var transitionEnd = (function () {
+
+ var el = document.createElement('bootstrap')
+ , transEndEventNames = {
+ 'WebkitTransition' : 'webkitTransitionEnd'
+ , 'MozTransition' : 'transitionend'
+ , 'OTransition' : 'oTransitionEnd'
+ , 'msTransition' : 'MSTransitionEnd'
+ , 'transition' : 'transitionend'
+ }
+ , name
+
+ for (name in transEndEventNames){
+ if (el.style[name] !== undefined) {
+ return transEndEventNames[name]
+ }
+ }
+
+ }())
+
+ return transitionEnd && {
+ end: transitionEnd
+ }
+
+ })()
+
+ })
+
+}(window.jQuery);
+/* =========================================================
+ * bootstrap-modal.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#modals
+ * =========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================= */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* MODAL CLASS DEFINITION
+ * ====================== */
+
+ var Modal = function (content, options) {
+ this.options = options
+ this.$element = $(content)
+ .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this))
+ }
+
+ Modal.prototype = {
+
+ constructor: Modal
+
+ , toggle: function () {
+ return this[!this.isShown ? 'show' : 'hide']()
+ }
+
+ , show: function () {
+ var that = this
+ , e = $.Event('show')
+
+ this.$element.trigger(e)
+
+ if (this.isShown || e.isDefaultPrevented()) return
+
+ $('body').addClass('modal-open')
+
+ this.isShown = true
+
+ escape.call(this)
+ backdrop.call(this, function () {
+ var transition = $.support.transition && that.$element.hasClass('fade')
+
+ if (!that.$element.parent().length) {
+ that.$element.appendTo(document.body) //don't move modals dom position
+ }
+
+ that.$element
+ .show()
+
+ if (transition) {
+ that.$element[0].offsetWidth // force reflow
+ }
+
+ that.$element.addClass('in')
+
+ transition ?
+ that.$element.one($.support.transition.end, function () { that.$element.trigger('shown') }) :
+ that.$element.trigger('shown')
+
+ })
+ }
+
+ , hide: function (e) {
+ e && e.preventDefault()
+
+ var that = this
+
+ e = $.Event('hide')
+
+ this.$element.trigger(e)
+
+ if (!this.isShown || e.isDefaultPrevented()) return
+
+ this.isShown = false
+
+ $('body').removeClass('modal-open')
+
+ escape.call(this)
+
+ this.$element.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade') ?
+ hideWithTransition.call(this) :
+ hideModal.call(this)
+ }
+
+ }
+
+
+ /* MODAL PRIVATE METHODS
+ * ===================== */
+
+ function hideWithTransition() {
+ var that = this
+ , timeout = setTimeout(function () {
+ that.$element.off($.support.transition.end)
+ hideModal.call(that)
+ }, 500)
+
+ this.$element.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ hideModal.call(that)
+ })
+ }
+
+ function hideModal(that) {
+ this.$element
+ .hide()
+ .trigger('hidden')
+
+ backdrop.call(this)
+ }
+
+ function backdrop(callback) {
+ var that = this
+ , animate = this.$element.hasClass('fade') ? 'fade' : ''
+
+ if (this.isShown && this.options.backdrop) {
+ var doAnimate = $.support.transition && animate
+
+ this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
+ .appendTo(document.body)
+
+ if (this.options.backdrop != 'static') {
+ this.$backdrop.click($.proxy(this.hide, this))
+ }
+
+ if (doAnimate) this.$backdrop[0].offsetWidth // force reflow
+
+ this.$backdrop.addClass('in')
+
+ doAnimate ?
+ this.$backdrop.one($.support.transition.end, callback) :
+ callback()
+
+ } else if (!this.isShown && this.$backdrop) {
+ this.$backdrop.removeClass('in')
+
+ $.support.transition && this.$element.hasClass('fade')?
+ this.$backdrop.one($.support.transition.end, $.proxy(removeBackdrop, this)) :
+ removeBackdrop.call(this)
+
+ } else if (callback) {
+ callback()
+ }
+ }
+
+ function removeBackdrop() {
+ this.$backdrop.remove()
+ this.$backdrop = null
+ }
+
+ function escape() {
+ var that = this
+ if (this.isShown && this.options.keyboard) {
+ $(document).on('keyup.dismiss.modal', function ( e ) {
+ e.which == 27 && that.hide()
+ })
+ } else if (!this.isShown) {
+ $(document).off('keyup.dismiss.modal')
+ }
+ }
+
+
+ /* MODAL PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.modal = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('modal')
+ , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
+ if (!data) $this.data('modal', (data = new Modal(this, options)))
+ if (typeof option == 'string') data[option]()
+ else if (options.show) data.show()
+ })
+ }
+
+ $.fn.modal.defaults = {
+ backdrop: true
+ , keyboard: true
+ , show: true
+ }
+
+ $.fn.modal.Constructor = Modal
+
+
+ /* MODAL DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.modal.data-api', '[data-toggle="modal"]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , option = $target.data('modal') ? 'toggle' : $.extend({}, $target.data(), $this.data())
+
+ e.preventDefault()
+ $target.modal(option)
+ })
+ })
+
+}(window.jQuery);
+/* ============================================================
+ * bootstrap-dropdown.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#dropdowns
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* DROPDOWN CLASS DEFINITION
+ * ========================= */
+
+ var toggle = '[data-toggle="dropdown"]'
+ , Dropdown = function (element) {
+ var $el = $(element).on('click.dropdown.data-api', this.toggle)
+ $('html').on('click.dropdown.data-api', function () {
+ $el.parent().removeClass('open')
+ })
+ }
+
+ Dropdown.prototype = {
+
+ constructor: Dropdown
+
+ , toggle: function (e) {
+ var $this = $(this)
+ , $parent
+ , selector
+ , isActive
+
+ if ($this.is('.disabled, :disabled')) return
+
+ selector = $this.attr('data-target')
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+ $parent.length || ($parent = $this.parent())
+
+ isActive = $parent.hasClass('open')
+
+ clearMenus()
+
+ if (!isActive) $parent.toggleClass('open')
+
+ return false
+ }
+
+ }
+
+ function clearMenus() {
+ $(toggle).parent().removeClass('open')
+ }
+
+
+ /* DROPDOWN PLUGIN DEFINITION
+ * ========================== */
+
+ $.fn.dropdown = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('dropdown')
+ if (!data) $this.data('dropdown', (data = new Dropdown(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.dropdown.Constructor = Dropdown
+
+
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
+ * =================================== */
+
+ $(function () {
+ $('html').on('click.dropdown.data-api', clearMenus)
+ $('body')
+ .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() })
+ .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
+ })
+
+}(window.jQuery);
+/* =============================================================
+ * bootstrap-scrollspy.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#scrollspy
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* SCROLLSPY CLASS DEFINITION
+ * ========================== */
+
+ function ScrollSpy( element, options) {
+ var process = $.proxy(this.process, this)
+ , $element = $(element).is('body') ? $(window) : $(element)
+ , href
+ this.options = $.extend({}, $.fn.scrollspy.defaults, options)
+ this.$scrollElement = $element.on('scroll.scroll.data-api', process)
+ this.selector = (this.options.target
+ || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ || '') + ' .nav li > a'
+ this.$body = $('body')
+ this.refresh()
+ this.process()
+ }
+
+ ScrollSpy.prototype = {
+
+ constructor: ScrollSpy
+
+ , refresh: function () {
+ var self = this
+ , $targets
+
+ this.offsets = $([])
+ this.targets = $([])
+
+ $targets = this.$body
+ .find(this.selector)
+ .map(function () {
+ var $el = $(this)
+ , href = $el.data('target') || $el.attr('href')
+ , $href = /^#\w/.test(href) && $(href)
+ return ( $href
+ && href.length
+ && [[ $href.position().top, href ]] ) || null
+ })
+ .sort(function (a, b) { return a[0] - b[0] })
+ .each(function () {
+ self.offsets.push(this[0])
+ self.targets.push(this[1])
+ })
+ }
+
+ , process: function () {
+ var scrollTop = this.$scrollElement.scrollTop() + this.options.offset
+ , scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight
+ , maxScroll = scrollHeight - this.$scrollElement.height()
+ , offsets = this.offsets
+ , targets = this.targets
+ , activeTarget = this.activeTarget
+ , i
+
+ if (scrollTop >= maxScroll) {
+ return activeTarget != (i = targets.last()[0])
+ && this.activate ( i )
+ }
+
+ for (i = offsets.length; i--;) {
+ activeTarget != targets[i]
+ && scrollTop >= offsets[i]
+ && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
+ && this.activate( targets[i] )
+ }
+ }
+
+ , activate: function (target) {
+ var active
+ , selector
+
+ this.activeTarget = target
+
+ $(this.selector)
+ .parent('.active')
+ .removeClass('active')
+
+ selector = this.selector
+ + '[data-target="' + target + '"],'
+ + this.selector + '[href="' + target + '"]'
+
+ active = $(selector)
+ .parent('li')
+ .addClass('active')
+
+ if (active.parent('.dropdown-menu')) {
+ active = active.closest('li.dropdown').addClass('active')
+ }
+
+ active.trigger('activate')
+ }
+
+ }
+
+
+ /* SCROLLSPY PLUGIN DEFINITION
+ * =========================== */
+
+ $.fn.scrollspy = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('scrollspy')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('scrollspy', (data = new ScrollSpy(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.scrollspy.Constructor = ScrollSpy
+
+ $.fn.scrollspy.defaults = {
+ offset: 10
+ }
+
+
+ /* SCROLLSPY DATA-API
+ * ================== */
+
+ $(function () {
+ $('[data-spy="scroll"]').each(function () {
+ var $spy = $(this)
+ $spy.scrollspy($spy.data())
+ })
+ })
+
+}(window.jQuery);
+/* ========================================================
+ * bootstrap-tab.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tabs
+ * ========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ======================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TAB CLASS DEFINITION
+ * ==================== */
+
+ var Tab = function ( element ) {
+ this.element = $(element)
+ }
+
+ Tab.prototype = {
+
+ constructor: Tab
+
+ , show: function () {
+ var $this = this.element
+ , $ul = $this.closest('ul:not(.dropdown-menu)')
+ , selector = $this.attr('data-target')
+ , previous
+ , $target
+ , e
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ if ( $this.parent('li').hasClass('active') ) return
+
+ previous = $ul.find('.active a').last()[0]
+
+ e = $.Event('show', {
+ relatedTarget: previous
+ })
+
+ $this.trigger(e)
+
+ if (e.isDefaultPrevented()) return
+
+ $target = $(selector)
+
+ this.activate($this.parent('li'), $ul)
+ this.activate($target, $target.parent(), function () {
+ $this.trigger({
+ type: 'shown'
+ , relatedTarget: previous
+ })
+ })
+ }
+
+ , activate: function ( element, container, callback) {
+ var $active = container.find('> .active')
+ , transition = callback
+ && $.support.transition
+ && $active.hasClass('fade')
+
+ function next() {
+ $active
+ .removeClass('active')
+ .find('> .dropdown-menu > .active')
+ .removeClass('active')
+
+ element.addClass('active')
+
+ if (transition) {
+ element[0].offsetWidth // reflow for transition
+ element.addClass('in')
+ } else {
+ element.removeClass('fade')
+ }
+
+ if ( element.parent('.dropdown-menu') ) {
+ element.closest('li.dropdown').addClass('active')
+ }
+
+ callback && callback()
+ }
+
+ transition ?
+ $active.one($.support.transition.end, next) :
+ next()
+
+ $active.removeClass('in')
+ }
+ }
+
+
+ /* TAB PLUGIN DEFINITION
+ * ===================== */
+
+ $.fn.tab = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('tab')
+ if (!data) $this.data('tab', (data = new Tab(this)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.tab.Constructor = Tab
+
+
+ /* TAB DATA-API
+ * ============ */
+
+ $(function () {
+ $('body').on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
+ e.preventDefault()
+ $(this).tab('show')
+ })
+ })
+
+}(window.jQuery);
+/* ===========================================================
+ * bootstrap-tooltip.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#tooltips
+ * Inspired by the original jQuery.tipsy by Jason Frame
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* TOOLTIP PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Tooltip = function (element, options) {
+ this.init('tooltip', element, options)
+ }
+
+ Tooltip.prototype = {
+
+ constructor: Tooltip
+
+ , init: function (type, element, options) {
+ var eventIn
+ , eventOut
+
+ this.type = type
+ this.$element = $(element)
+ this.options = this.getOptions(options)
+ this.enabled = true
+
+ if (this.options.trigger != 'manual') {
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
+ eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
+ this.$element.on(eventIn, this.options.selector, $.proxy(this.enter, this))
+ this.$element.on(eventOut, this.options.selector, $.proxy(this.leave, this))
+ }
+
+ this.options.selector ?
+ (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) :
+ this.fixTitle()
+ }
+
+ , getOptions: function (options) {
+ options = $.extend({}, $.fn[this.type].defaults, options, this.$element.data())
+
+ if (options.delay && typeof options.delay == 'number') {
+ options.delay = {
+ show: options.delay
+ , hide: options.delay
+ }
+ }
+
+ return options
+ }
+
+ , enter: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ if (!self.options.delay || !self.options.delay.show) return self.show()
+
+ clearTimeout(this.timeout)
+ self.hoverState = 'in'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'in') self.show()
+ }, self.options.delay.show)
+ }
+
+ , leave: function (e) {
+ var self = $(e.currentTarget)[this.type](this._options).data(this.type)
+
+ if (this.timeout) clearTimeout(this.timeout)
+ if (!self.options.delay || !self.options.delay.hide) return self.hide()
+
+ self.hoverState = 'out'
+ this.timeout = setTimeout(function() {
+ if (self.hoverState == 'out') self.hide()
+ }, self.options.delay.hide)
+ }
+
+ , show: function () {
+ var $tip
+ , inside
+ , pos
+ , actualWidth
+ , actualHeight
+ , placement
+ , tp
+
+ if (this.hasContent() && this.enabled) {
+ $tip = this.tip()
+ this.setContent()
+
+ if (this.options.animation) {
+ $tip.addClass('fade')
+ }
+
+ placement = typeof this.options.placement == 'function' ?
+ this.options.placement.call(this, $tip[0], this.$element[0]) :
+ this.options.placement
+
+ inside = /in/.test(placement)
+
+ $tip
+ .remove()
+ .css({ top: 0, left: 0, display: 'block' })
+ .appendTo(inside ? this.$element : document.body)
+
+ pos = this.getPosition(inside)
+
+ actualWidth = $tip[0].offsetWidth
+ actualHeight = $tip[0].offsetHeight
+
+ switch (inside ? placement.split(' ')[1] : placement) {
+ case 'bottom':
+ tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'top':
+ tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2}
+ break
+ case 'left':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth}
+ break
+ case 'right':
+ tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width}
+ break
+ }
+
+ $tip
+ .css(tp)
+ .addClass(placement)
+ .addClass('in')
+ }
+ }
+
+ , isHTML: function(text) {
+ // html string detection logic adapted from jQuery
+ return typeof text != 'string'
+ || ( text.charAt(0) === "<"
+ && text.charAt( text.length - 1 ) === ">"
+ && text.length >= 3
+ ) || /^(?:[^<]*<[\w\W]+>[^>]*$)/.exec(text)
+ }
+
+ , setContent: function () {
+ var $tip = this.tip()
+ , title = this.getTitle()
+
+ $tip.find('.tooltip-inner')[this.isHTML(title) ? 'html' : 'text'](title)
+ $tip.removeClass('fade in top bottom left right')
+ }
+
+ , hide: function () {
+ var that = this
+ , $tip = this.tip()
+
+ $tip.removeClass('in')
+
+ function removeWithAnimation() {
+ var timeout = setTimeout(function () {
+ $tip.off($.support.transition.end).remove()
+ }, 500)
+
+ $tip.one($.support.transition.end, function () {
+ clearTimeout(timeout)
+ $tip.remove()
+ })
+ }
+
+ $.support.transition && this.$tip.hasClass('fade') ?
+ removeWithAnimation() :
+ $tip.remove()
+ }
+
+ , fixTitle: function () {
+ var $e = this.$element
+ if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') {
+ $e.attr('data-original-title', $e.attr('title') || '').removeAttr('title')
+ }
+ }
+
+ , hasContent: function () {
+ return this.getTitle()
+ }
+
+ , getPosition: function (inside) {
+ return $.extend({}, (inside ? {top: 0, left: 0} : this.$element.offset()), {
+ width: this.$element[0].offsetWidth
+ , height: this.$element[0].offsetHeight
+ })
+ }
+
+ , getTitle: function () {
+ var title
+ , $e = this.$element
+ , o = this.options
+
+ title = $e.attr('data-original-title')
+ || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title)
+
+ return title
+ }
+
+ , tip: function () {
+ return this.$tip = this.$tip || $(this.options.template)
+ }
+
+ , validate: function () {
+ if (!this.$element[0].parentNode) {
+ this.hide()
+ this.$element = null
+ this.options = null
+ }
+ }
+
+ , enable: function () {
+ this.enabled = true
+ }
+
+ , disable: function () {
+ this.enabled = false
+ }
+
+ , toggleEnabled: function () {
+ this.enabled = !this.enabled
+ }
+
+ , toggle: function () {
+ this[this.tip().hasClass('in') ? 'hide' : 'show']()
+ }
+
+ }
+
+
+ /* TOOLTIP PLUGIN DEFINITION
+ * ========================= */
+
+ $.fn.tooltip = function ( option ) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('tooltip')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('tooltip', (data = new Tooltip(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.tooltip.Constructor = Tooltip
+
+ $.fn.tooltip.defaults = {
+ animation: true
+ , placement: 'top'
+ , selector: false
+ , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'
+ , trigger: 'hover'
+ , title: ''
+ , delay: 0
+ }
+
+}(window.jQuery);
+
+/* ===========================================================
+ * bootstrap-popover.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#popovers
+ * ===========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * =========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* POPOVER PUBLIC CLASS DEFINITION
+ * =============================== */
+
+ var Popover = function ( element, options ) {
+ this.init('popover', element, options)
+ }
+
+
+ /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js
+ ========================================== */
+
+ Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, {
+
+ constructor: Popover
+
+ , setContent: function () {
+ var $tip = this.tip()
+ , title = this.getTitle()
+ , content = this.getContent()
+
+ $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title)
+ $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content)
+
+ $tip.removeClass('fade top bottom left right in')
+ }
+
+ , hasContent: function () {
+ return this.getTitle() || this.getContent()
+ }
+
+ , getContent: function () {
+ var content
+ , $e = this.$element
+ , o = this.options
+
+ content = $e.attr('data-content')
+ || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content)
+
+ return content
+ }
+
+ , tip: function () {
+ if (!this.$tip) {
+ this.$tip = $(this.options.template)
+ }
+ return this.$tip
+ }
+
+ })
+
+
+ /* POPOVER PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.popover = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('popover')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('popover', (data = new Popover(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.popover.Constructor = Popover
+
+ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, {
+ placement: 'right'
+ , content: ''
+ , template: '<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'
+ })
+
+}(window.jQuery);
+/* ==========================================================
+ * bootstrap-alert.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#alerts
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* ALERT CLASS DEFINITION
+ * ====================== */
+
+ var dismiss = '[data-dismiss="alert"]'
+ , Alert = function (el) {
+ $(el).on('click', dismiss, this.close)
+ }
+
+ Alert.prototype.close = function (e) {
+ var $this = $(this)
+ , selector = $this.attr('data-target')
+ , $parent
+
+ if (!selector) {
+ selector = $this.attr('href')
+ selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
+ }
+
+ $parent = $(selector)
+
+ e && e.preventDefault()
+
+ $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
+
+ $parent.trigger(e = $.Event('close'))
+
+ if (e.isDefaultPrevented()) return
+
+ $parent.removeClass('in')
+
+ function removeElement() {
+ $parent
+ .trigger('closed')
+ .remove()
+ }
+
+ $.support.transition && $parent.hasClass('fade') ?
+ $parent.on($.support.transition.end, removeElement) :
+ removeElement()
+ }
+
+
+ /* ALERT PLUGIN DEFINITION
+ * ======================= */
+
+ $.fn.alert = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('alert')
+ if (!data) $this.data('alert', (data = new Alert(this)))
+ if (typeof option == 'string') data[option].call($this)
+ })
+ }
+
+ $.fn.alert.Constructor = Alert
+
+
+ /* ALERT DATA-API
+ * ============== */
+
+ $(function () {
+ $('body').on('click.alert.data-api', dismiss, Alert.prototype.close)
+ })
+
+}(window.jQuery);
+/* ============================================================
+ * bootstrap-button.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#buttons
+ * ============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* BUTTON PUBLIC CLASS DEFINITION
+ * ============================== */
+
+ var Button = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.button.defaults, options)
+ }
+
+ Button.prototype.setState = function (state) {
+ var d = 'disabled'
+ , $el = this.$element
+ , data = $el.data()
+ , val = $el.is('input') ? 'val' : 'html'
+
+ state = state + 'Text'
+ data.resetText || $el.data('resetText', $el[val]())
+
+ $el[val](data[state] || this.options[state])
+
+ // push to event loop to allow forms to submit
+ setTimeout(function () {
+ state == 'loadingText' ?
+ $el.addClass(d).attr(d, d) :
+ $el.removeClass(d).removeAttr(d)
+ }, 0)
+ }
+
+ Button.prototype.toggle = function () {
+ var $parent = this.$element.parent('[data-toggle="buttons-radio"]')
+
+ $parent && $parent
+ .find('.active')
+ .removeClass('active')
+
+ this.$element.toggleClass('active')
+ }
+
+
+ /* BUTTON PLUGIN DEFINITION
+ * ======================== */
+
+ $.fn.button = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('button')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('button', (data = new Button(this, options)))
+ if (option == 'toggle') data.toggle()
+ else if (option) data.setState(option)
+ })
+ }
+
+ $.fn.button.defaults = {
+ loadingText: 'loading...'
+ }
+
+ $.fn.button.Constructor = Button
+
+
+ /* BUTTON DATA-API
+ * =============== */
+
+ $(function () {
+ $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) {
+ var $btn = $(e.target)
+ if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn')
+ $btn.button('toggle')
+ })
+ })
+
+}(window.jQuery);
+/* =============================================================
+ * bootstrap-collapse.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#collapse
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* COLLAPSE PUBLIC CLASS DEFINITION
+ * ================================ */
+
+ var Collapse = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.collapse.defaults, options)
+
+ if (this.options.parent) {
+ this.$parent = $(this.options.parent)
+ }
+
+ this.options.toggle && this.toggle()
+ }
+
+ Collapse.prototype = {
+
+ constructor: Collapse
+
+ , dimension: function () {
+ var hasWidth = this.$element.hasClass('width')
+ return hasWidth ? 'width' : 'height'
+ }
+
+ , show: function () {
+ var dimension
+ , scroll
+ , actives
+ , hasData
+
+ if (this.transitioning) return
+
+ dimension = this.dimension()
+ scroll = $.camelCase(['scroll', dimension].join('-'))
+ actives = this.$parent && this.$parent.find('> .accordion-group > .in')
+
+ if (actives && actives.length) {
+ hasData = actives.data('collapse')
+ if (hasData && hasData.transitioning) return
+ actives.collapse('hide')
+ hasData || actives.data('collapse', null)
+ }
+
+ this.$element[dimension](0)
+ this.transition('addClass', $.Event('show'), 'shown')
+ this.$element[dimension](this.$element[0][scroll])
+ }
+
+ , hide: function () {
+ var dimension
+ if (this.transitioning) return
+ dimension = this.dimension()
+ this.reset(this.$element[dimension]())
+ this.transition('removeClass', $.Event('hide'), 'hidden')
+ this.$element[dimension](0)
+ }
+
+ , reset: function (size) {
+ var dimension = this.dimension()
+
+ this.$element
+ .removeClass('collapse')
+ [dimension](size || 'auto')
+ [0].offsetWidth
+
+ this.$element[size !== null ? 'addClass' : 'removeClass']('collapse')
+
+ return this
+ }
+
+ , transition: function (method, startEvent, completeEvent) {
+ var that = this
+ , complete = function () {
+ if (startEvent.type == 'show') that.reset()
+ that.transitioning = 0
+ that.$element.trigger(completeEvent)
+ }
+
+ this.$element.trigger(startEvent)
+
+ if (startEvent.isDefaultPrevented()) return
+
+ this.transitioning = 1
+
+ this.$element[method]('in')
+
+ $.support.transition && this.$element.hasClass('collapse') ?
+ this.$element.one($.support.transition.end, complete) :
+ complete()
+ }
+
+ , toggle: function () {
+ this[this.$element.hasClass('in') ? 'hide' : 'show']()
+ }
+
+ }
+
+
+ /* COLLAPSIBLE PLUGIN DEFINITION
+ * ============================== */
+
+ $.fn.collapse = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('collapse')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('collapse', (data = new Collapse(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.collapse.defaults = {
+ toggle: true
+ }
+
+ $.fn.collapse.Constructor = Collapse
+
+
+ /* COLLAPSIBLE DATA-API
+ * ==================== */
+
+ $(function () {
+ $('body').on('click.collapse.data-api', '[data-toggle=collapse]', function ( e ) {
+ var $this = $(this), href
+ , target = $this.attr('data-target')
+ || e.preventDefault()
+ || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7
+ , option = $(target).data('collapse') ? 'toggle' : $this.data()
+ $(target).collapse(option)
+ })
+ })
+
+}(window.jQuery);
+/* ==========================================================
+ * bootstrap-carousel.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#carousel
+ * ==========================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ========================================================== */
+
+
+!function ($) {
+
+ "use strict"; // jshint ;_;
+
+
+ /* CAROUSEL CLASS DEFINITION
+ * ========================= */
+
+ var Carousel = function (element, options) {
+ this.$element = $(element)
+ this.options = options
+ this.options.slide && this.slide(this.options.slide)
+ this.options.pause == 'hover' && this.$element
+ .on('mouseenter', $.proxy(this.pause, this))
+ .on('mouseleave', $.proxy(this.cycle, this))
+ }
+
+ Carousel.prototype = {
+
+ cycle: function (e) {
+ if (!e) this.paused = false
+ this.options.interval
+ && !this.paused
+ && (this.interval = setInterval($.proxy(this.next, this), this.options.interval))
+ return this
+ }
+
+ , to: function (pos) {
+ var $active = this.$element.find('.active')
+ , children = $active.parent().children()
+ , activePos = children.index($active)
+ , that = this
+
+ if (pos > (children.length - 1) || pos < 0) return
+
+ if (this.sliding) {
+ return this.$element.one('slid', function () {
+ that.to(pos)
+ })
+ }
+
+ if (activePos == pos) {
+ return this.pause().cycle()
+ }
+
+ return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos]))
+ }
+
+ , pause: function (e) {
+ if (!e) this.paused = true
+ clearInterval(this.interval)
+ this.interval = null
+ return this
+ }
+
+ , next: function () {
+ if (this.sliding) return
+ return this.slide('next')
+ }
+
+ , prev: function () {
+ if (this.sliding) return
+ return this.slide('prev')
+ }
+
+ , slide: function (type, next) {
+ var $active = this.$element.find('.active')
+ , $next = next || $active[type]()
+ , isCycling = this.interval
+ , direction = type == 'next' ? 'left' : 'right'
+ , fallback = type == 'next' ? 'first' : 'last'
+ , that = this
+ , e = $.Event('slide')
+
+ this.sliding = true
+
+ isCycling && this.pause()
+
+ $next = $next.length ? $next : this.$element.find('.item')[fallback]()
+
+ if ($next.hasClass('active')) return
+
+ if ($.support.transition && this.$element.hasClass('slide')) {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $next.addClass(type)
+ $next[0].offsetWidth // force reflow
+ $active.addClass(direction)
+ $next.addClass(direction)
+ this.$element.one($.support.transition.end, function () {
+ $next.removeClass([type, direction].join(' ')).addClass('active')
+ $active.removeClass(['active', direction].join(' '))
+ that.sliding = false
+ setTimeout(function () { that.$element.trigger('slid') }, 0)
+ })
+ } else {
+ this.$element.trigger(e)
+ if (e.isDefaultPrevented()) return
+ $active.removeClass('active')
+ $next.addClass('active')
+ this.sliding = false
+ this.$element.trigger('slid')
+ }
+
+ isCycling && this.cycle()
+
+ return this
+ }
+
+ }
+
+
+ /* CAROUSEL PLUGIN DEFINITION
+ * ========================== */
+
+ $.fn.carousel = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('carousel')
+ , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option)
+ if (!data) $this.data('carousel', (data = new Carousel(this, options)))
+ if (typeof option == 'number') data.to(option)
+ else if (typeof option == 'string' || (option = options.slide)) data[option]()
+ else if (options.interval) data.cycle()
+ })
+ }
+
+ $.fn.carousel.defaults = {
+ interval: 5000
+ , pause: 'hover'
+ }
+
+ $.fn.carousel.Constructor = Carousel
+
+
+ /* CAROUSEL DATA-API
+ * ================= */
+
+ $(function () {
+ $('body').on('click.carousel.data-api', '[data-slide]', function ( e ) {
+ var $this = $(this), href
+ , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
+ , options = !$target.data('modal') && $.extend({}, $target.data(), $this.data())
+ $target.carousel(options)
+ e.preventDefault()
+ })
+ })
+
+}(window.jQuery);
+/* =============================================================
+ * bootstrap-typeahead.js v2.0.4
+ * http://twitter.github.com/bootstrap/javascript.html#typeahead
+ * =============================================================
+ * Copyright 2012 Twitter, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============================================================ */
+
+
+!function($){
+
+ "use strict"; // jshint ;_;
+
+
+ /* TYPEAHEAD PUBLIC CLASS DEFINITION
+ * ================================= */
+
+ var Typeahead = function (element, options) {
+ this.$element = $(element)
+ this.options = $.extend({}, $.fn.typeahead.defaults, options)
+ this.matcher = this.options.matcher || this.matcher
+ this.sorter = this.options.sorter || this.sorter
+ this.highlighter = this.options.highlighter || this.highlighter
+ this.updater = this.options.updater || this.updater
+ this.$menu = $(this.options.menu).appendTo('body')
+ this.source = this.options.source
+ this.shown = false
+ this.listen()
+ }
+
+ Typeahead.prototype = {
+
+ constructor: Typeahead
+
+ , select: function () {
+ var val = this.$menu.find('.active').attr('data-value')
+ this.$element
+ .val(this.updater(val))
+ .change()
+ return this.hide()
+ }
+
+ , updater: function (item) {
+ return item
+ }
+
+ , show: function () {
+ var pos = $.extend({}, this.$element.offset(), {
+ height: this.$element[0].offsetHeight
+ })
+
+ this.$menu.css({
+ top: pos.top + pos.height
+ , left: pos.left
+ })
+
+ this.$menu.show()
+ this.shown = true
+ return this
+ }
+
+ , hide: function () {
+ this.$menu.hide()
+ this.shown = false
+ return this
+ }
+
+ , lookup: function (event) {
+ var that = this
+ , items
+ , q
+
+ this.query = this.$element.val()
+
+ if (!this.query) {
+ return this.shown ? this.hide() : this
+ }
+
+ items = $.grep(this.source, function (item) {
+ return that.matcher(item)
+ })
+
+ items = this.sorter(items)
+
+ if (!items.length) {
+ return this.shown ? this.hide() : this
+ }
+
+ return this.render(items.slice(0, this.options.items)).show()
+ }
+
+ , matcher: function (item) {
+ return ~item.toLowerCase().indexOf(this.query.toLowerCase())
+ }
+
+ , sorter: function (items) {
+ var beginswith = []
+ , caseSensitive = []
+ , caseInsensitive = []
+ , item
+
+ while (item = items.shift()) {
+ if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item)
+ else if (~item.indexOf(this.query)) caseSensitive.push(item)
+ else caseInsensitive.push(item)
+ }
+
+ return beginswith.concat(caseSensitive, caseInsensitive)
+ }
+
+ , highlighter: function (item) {
+ var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&')
+ return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
+ return '<strong>' + match + '</strong>'
+ })
+ }
+
+ , render: function (items) {
+ var that = this
+
+ items = $(items).map(function (i, item) {
+ i = $(that.options.item).attr('data-value', item)
+ i.find('a').html(that.highlighter(item))
+ return i[0]
+ })
+
+ items.first().addClass('active')
+ this.$menu.html(items)
+ return this
+ }
+
+ , next: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , next = active.next()
+
+ if (!next.length) {
+ next = $(this.$menu.find('li')[0])
+ }
+
+ next.addClass('active')
+ }
+
+ , prev: function (event) {
+ var active = this.$menu.find('.active').removeClass('active')
+ , prev = active.prev()
+
+ if (!prev.length) {
+ prev = this.$menu.find('li').last()
+ }
+
+ prev.addClass('active')
+ }
+
+ , listen: function () {
+ this.$element
+ .on('blur', $.proxy(this.blur, this))
+ .on('keypress', $.proxy(this.keypress, this))
+ .on('keyup', $.proxy(this.keyup, this))
+
+ if ($.browser.webkit || $.browser.msie) {
+ this.$element.on('keydown', $.proxy(this.keypress, this))
+ }
+
+ this.$menu
+ .on('click', $.proxy(this.click, this))
+ .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
+ }
+
+ , keyup: function (e) {
+ switch(e.keyCode) {
+ case 40: // down arrow
+ case 38: // up arrow
+ break
+
+ case 9: // tab
+ case 13: // enter
+ if (!this.shown) return
+ this.select()
+ break
+
+ case 27: // escape
+ if (!this.shown) return
+ this.hide()
+ break
+
+ default:
+ this.lookup()
+ }
+
+ e.stopPropagation()
+ e.preventDefault()
+ }
+
+ , keypress: function (e) {
+ if (!this.shown) return
+
+ switch(e.keyCode) {
+ case 9: // tab
+ case 13: // enter
+ case 27: // escape
+ e.preventDefault()
+ break
+
+ case 38: // up arrow
+ if (e.type != 'keydown') break
+ e.preventDefault()
+ this.prev()
+ break
+
+ case 40: // down arrow
+ if (e.type != 'keydown') break
+ e.preventDefault()
+ this.next()
+ break
+ }
+
+ e.stopPropagation()
+ }
+
+ , blur: function (e) {
+ var that = this
+ setTimeout(function () { that.hide() }, 150)
+ }
+
+ , click: function (e) {
+ e.stopPropagation()
+ e.preventDefault()
+ this.select()
+ }
+
+ , mouseenter: function (e) {
+ this.$menu.find('.active').removeClass('active')
+ $(e.currentTarget).addClass('active')
+ }
+
+ }
+
+
+ /* TYPEAHEAD PLUGIN DEFINITION
+ * =========================== */
+
+ $.fn.typeahead = function (option) {
+ return this.each(function () {
+ var $this = $(this)
+ , data = $this.data('typeahead')
+ , options = typeof option == 'object' && option
+ if (!data) $this.data('typeahead', (data = new Typeahead(this, options)))
+ if (typeof option == 'string') data[option]()
+ })
+ }
+
+ $.fn.typeahead.defaults = {
+ source: []
+ , items: 8
+ , menu: '<ul class="typeahead dropdown-menu"></ul>'
+ , item: '<li><a href="#"></a></li>'
+ }
+
+ $.fn.typeahead.Constructor = Typeahead
+
+
+ /* TYPEAHEAD DATA-API
+ * ================== */
+
+ $(function () {
+ $('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
+ var $this = $(this)
+ if ($this.data('typeahead')) return
+ e.preventDefault()
+ $this.typeahead($this.data())
+ })
+ })
+
+}(window.jQuery);
\ No newline at end of file
=== added directory 'docs/_templates/ubuntu1210/static/js/src'
=== added directory 'docs/_templates/ubuntu1210/static/lib'
=== added file 'docs/_templates/ubuntu1210/static/lib/bootstrap.min.css'
--- docs/_templates/ubuntu1210/static/lib/bootstrap.min.css 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/static/lib/bootstrap.min.css 2013-10-09 20:38:29 +0000
@@ -0,0 +1,727 @@
+/*!
+ * Bootstrap v2.0.4
+ *
+ * Copyright 2012 Twitter, Inc
+ * Licensed under the Apache License v2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
+ */
+.clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:"";}
+.clearfix:after{clear:both;}
+.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0;}
+.input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}
+article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}
+audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}
+audio:not([controls]){display:none;}
+html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
+a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
+a:hover,a:active{outline:0;}
+sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}
+sup{top:-0.5em;}
+sub{bottom:-0.25em;}
+img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;}
+#map_canvas img{max-width:none;}
+button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;}
+button,input{*overflow:visible;line-height:normal;}
+button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;}
+button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button;}
+input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield;}
+input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none;}
+textarea{overflow:auto;vertical-align:top;}
+body{margin:0;color:#333333;background-color:#ffffff;}
+a{color:#0088cc;text-decoration:none;}
+a:hover{color:#005580;text-decoration:underline;}
+.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";}
+.row:after{clear:both;}
+[class*="span"]{float:left;margin-left:20px;}
+.container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}
+.span12{width:940px;}
+.span11{width:860px;}
+.span10{width:780px;}
+.span9{width:700px;}
+.span8{width:620px;}
+.span7{width:540px;}
+.span6{width:460px;}
+.span5{width:380px;}
+.span4{width:300px;}
+.span3{width:220px;}
+.span2{width:140px;}
+.span1{width:60px;}
+.offset12{margin-left:980px;}
+.offset11{margin-left:900px;}
+.offset10{margin-left:820px;}
+.offset9{margin-left:740px;}
+.offset8{margin-left:660px;}
+.offset7{margin-left:580px;}
+.offset6{margin-left:500px;}
+.offset5{margin-left:420px;}
+.offset4{margin-left:340px;}
+.offset3{margin-left:260px;}
+.offset2{margin-left:180px;}
+.offset1{margin-left:100px;}
+.row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";}
+.row-fluid:after{clear:both;}
+.row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.127659574%;*margin-left:2.0744680846382977%;}
+.row-fluid [class*="span"]:first-child{margin-left:0;}
+.row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;}
+.row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;}
+.row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;}
+.row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;}
+.row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;}
+.row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;}
+.row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;}
+.row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;}
+.row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;}
+.row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;}
+.row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;}
+.row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;}
+.container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{display:table;content:"";}
+.container:after{clear:both;}
+.container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,.container-fluid:after{display:table;content:"";}
+.container-fluid:after{clear:both;}
+p{margin:0 0 9px;}p small{font-size:11px;color:#999999;}
+.lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;}
+h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;color:#999999;}
+h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}
+h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}
+h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;}
+h4,h5,h6{line-height:18px;}
+h4{font-size:14px;}h4 small{font-size:12px;}
+h5{font-size:12px;}
+h6{font-size:11px;color:#999999;text-transform:uppercase;}
+.page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;}
+.page-header h1{line-height:1;}
+ul,ol{padding:0;margin:0 0 9px 25px;}
+ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}
+ul{list-style:disc;}
+ol{list-style:decimal;}
+li{line-height:18px;}
+ul.unstyled,ol.unstyled{margin-left:0;list-style:none;}
+dl{margin-bottom:18px;}
+dt,dd{line-height:18px;}
+dt{font-weight:bold;line-height:17px;}
+dd{margin-left:9px;}
+.dl-horizontal dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
+.dl-horizontal dd{margin-left:130px;}
+hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;}
+strong{font-weight:bold;}
+em{font-style:italic;}
+.muted{color:#999999;}
+abbr[title]{cursor:help;border-bottom:1px dotted #999999;}
+abbr.initialism{font-size:90%;text-transform:uppercase;}
+blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;}
+blockquote small{display:block;line-height:18px;color:#999999;}blockquote small:before{content:'\2014 \00A0';}
+blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right small{text-align:right;}
+q:before,q:after,blockquote:before,blockquote:after{content:"";}
+address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;}
+small{font-size:100%;}
+cite{font-style:normal;}
+code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,"Courier New",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
+code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;}
+pre{display:block;padding:8.5px;margin:0 0 9px;font-size:12.025px;line-height:18px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{margin-bottom:18px;}
+pre code{padding:0;color:inherit;background-color:transparent;border:0;}
+.pre-scrollable{max-height:340px;overflow-y:scroll;}
+.label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#999999;}
+.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
+.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}
+a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}
+.label-important,.badge-important{background-color:#b94a48;}
+.label-important[href],.badge-important[href]{background-color:#953b39;}
+.label-warning,.badge-warning{background-color:#f89406;}
+.label-warning[href],.badge-warning[href]{background-color:#c67605;}
+.label-success,.badge-success{background-color:#468847;}
+.label-success[href],.badge-success[href]{background-color:#356635;}
+.label-info,.badge-info{background-color:#3a87ad;}
+.label-info[href],.badge-info[href]{background-color:#2d6987;}
+.label-inverse,.badge-inverse{background-color:#333333;}
+.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;}
+table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;}
+.table{width:100%;margin-bottom:18px;}.table th,.table td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid #dddddd;}
+.table th{font-weight:bold;}
+.table thead th{vertical-align:bottom;}
+.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0;}
+.table tbody+tbody{border-top:2px solid #dddddd;}
+.table-condensed th,.table-condensed td{padding:4px 5px;}
+.table-bordered{border:1px solid #dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered td{border-left:1px solid #dddddd;}
+.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0;}
+.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px;}
+.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px;}
+.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;}
+.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;}
+.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9;}
+.table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;}
+table .span1{float:none;width:44px;margin-left:0;}
+table .span2{float:none;width:124px;margin-left:0;}
+table .span3{float:none;width:204px;margin-left:0;}
+table .span4{float:none;width:284px;margin-left:0;}
+table .span5{float:none;width:364px;margin-left:0;}
+table .span6{float:none;width:444px;margin-left:0;}
+table .span7{float:none;width:524px;margin-left:0;}
+table .span8{float:none;width:604px;margin-left:0;}
+table .span9{float:none;width:684px;margin-left:0;}
+table .span10{float:none;width:764px;margin-left:0;}
+table .span11{float:none;width:844px;margin-left:0;}
+table .span12{float:none;width:924px;margin-left:0;}
+table .span13{float:none;width:1004px;margin-left:0;}
+table .span14{float:none;width:1084px;margin-left:0;}
+table .span15{float:none;width:1164px;margin-left:0;}
+table .span16{float:none;width:1244px;margin-left:0;}
+table .span17{float:none;width:1324px;margin-left:0;}
+table .span18{float:none;width:1404px;margin-left:0;}
+table .span19{float:none;width:1484px;margin-left:0;}
+table .span20{float:none;width:1564px;margin-left:0;}
+table .span21{float:none;width:1644px;margin-left:0;}
+table .span22{float:none;width:1724px;margin-left:0;}
+table .span23{float:none;width:1804px;margin-left:0;}
+table .span24{float:none;width:1884px;margin-left:0;}
+/* form{margin:0 0 18px;} */
+fieldset{padding:0;margin:0;border:0;}
+legend{display:block;width:100%;padding:0;margin-bottom:27px;font-size:19.5px;line-height:36px;color:#333333;border:0;border-bottom:1px solid #e5e5e5;}legend small{font-size:13.5px;color:#999999;}
+label,input,button,select,textarea{font-size:13px;font-weight:normal;line-height:18px;}
+input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;}
+label{display:block;margin-bottom:5px;}
+select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:18px;padding:4px;margin-bottom:9px;font-size:13px;line-height:18px;color:#555555;}
+input,textarea{width:210px;}
+textarea{height:auto;}
+textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#ffffff;border:1px solid #cccccc;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-webkit-transition:border linear 0.2s,box-shadow linear 0.2s;-moz-transition:border linear 0.2s,box-shadow linear 0.2s;-ms-transition:border linear 0.2s,box-shadow linear 0.2s;-o-transition:border linear 0.2s,box-shadow linear 0.2s;transition:border linear 0.2s,box-shadow linear 0.2s;}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82, 168, 236, 0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(82,168,236,.6);}
+input[type="radio"],input[type="checkbox"]{margin:3px 0;*margin-top:0;line-height:normal;cursor:pointer;}
+input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto;}
+.uneditable-textarea{width:auto;height:auto;}
+select,input[type="file"]{height:28px;*margin-top:4px;line-height:28px;}
+select{width:220px;border:1px solid #bbb;}
+select[multiple],select[size]{height:auto;}
+select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
+.radio,.checkbox{min-height:18px;padding-left:18px;}
+.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px;}
+.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px;}
+.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle;}
+.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px;}
+.input-mini{width:60px;}
+.input-small{width:90px;}
+.input-medium{width:150px;}
+.input-large{width:210px;}
+.input-xlarge{width:270px;}
+.input-xxlarge{width:530px;}
+input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0;}
+.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block;}
+input,textarea,.uneditable-input{margin-left:0;}
+input.span12, textarea.span12, .uneditable-input.span12{width:930px;}
+input.span11, textarea.span11, .uneditable-input.span11{width:850px;}
+input.span10, textarea.span10, .uneditable-input.span10{width:770px;}
+input.span9, textarea.span9, .uneditable-input.span9{width:690px;}
+input.span8, textarea.span8, .uneditable-input.span8{width:610px;}
+input.span7, textarea.span7, .uneditable-input.span7{width:530px;}
+input.span6, textarea.span6, .uneditable-input.span6{width:450px;}
+input.span5, textarea.span5, .uneditable-input.span5{width:370px;}
+input.span4, textarea.span4, .uneditable-input.span4{width:290px;}
+input.span3, textarea.span3, .uneditable-input.span3{width:210px;}
+input.span2, textarea.span2, .uneditable-input.span2{width:130px;}
+input.span1, textarea.span1, .uneditable-input.span1{width:50px;}
+input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eeeeee;border-color:#ddd;}
+input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent;}
+.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853;}
+.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:0 0 6px #dbc59e;-moz-box-shadow:0 0 6px #dbc59e;box-shadow:0 0 6px #dbc59e;}
+.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853;}
+.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48;}
+.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:0 0 6px #d59392;-moz-box-shadow:0 0 6px #d59392;box-shadow:0 0 6px #d59392;}
+.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48;}
+.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847;}
+.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:0 0 6px #7aba7b;-moz-box-shadow:0 0 6px #7aba7b;box-shadow:0 0 6px #7aba7b;}
+.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847;}
+input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b;}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7;}
+.form-actions{padding:17px 20px 18px;margin-top:18px;margin-bottom:18px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1;}.form-actions:before,.form-actions:after{display:table;content:"";}
+.form-actions:after{clear:both;}
+.uneditable-input{overflow:hidden;white-space:nowrap;cursor:not-allowed;background-color:#ffffff;border-color:#eee;-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.025);}
+:-moz-placeholder{color:#999999;}
+:-ms-input-placeholder{color:#999999;}
+::-webkit-input-placeholder{color:#999999;}
+.help-block,.help-inline{color:#555555;}
+.help-block{display:block;margin-bottom:9px;}
+.help-inline{display:inline-block;*display:inline;*zoom:1;vertical-align:middle;padding-left:5px;}
+.input-prepend,.input-append{margin-bottom:5px;}.input-prepend input,.input-append input,.input-prepend select,.input-append select,.input-prepend .uneditable-input,.input-append .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:middle;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}.input-prepend input:focus,.input-append input:focus,.input-prepend select:focus,.input-append select:focus,.input-prepend .uneditable-input:focus,.input-append .uneditable-input:focus{z-index:2;}
+.input-prepend .uneditable-input,.input-append .uneditable-input{border-left-color:#ccc;}
+.input-prepend .add-on,.input-append .add-on{display:inline-block;width:auto;height:18px;min-width:16px;padding:4px 5px;font-weight:normal;line-height:18px;text-align:center;text-shadow:0 1px 0 #ffffff;vertical-align:middle;background-color:#eeeeee;border:1px solid #ccc;}
+.input-prepend .add-on,.input-append .add-on,.input-prepend .btn,.input-append .btn{margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
+.input-prepend .active,.input-append .active{background-color:#a9dba9;border-color:#46a546;}
+.input-prepend .add-on,.input-prepend .btn{margin-right:-1px;}
+.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
+.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
+.input-append .uneditable-input{border-right-color:#ccc;border-left-color:#eee;}
+.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
+.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
+.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
+.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
+.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:14px;-moz-border-radius:14px;border-radius:14px;}
+.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;*zoom:1;margin-bottom:0;}
+.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none;}
+.form-search label,.form-inline label{display:inline-block;}
+.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0;}
+.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle;}
+.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0;}
+.control-group{margin-bottom:9px;}
+legend+.control-group{margin-top:18px;-webkit-margin-top-collapse:separate;}
+.form-horizontal .control-group{margin-bottom:18px;*zoom:1;}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;content:"";}
+.form-horizontal .control-group:after{clear:both;}
+.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right;}
+.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:160px;*margin-left:0;}.form-horizontal .controls:first-child{*padding-left:160px;}
+.form-horizontal .help-block{margin-top:9px;margin-bottom:0;}
+.form-horizontal .form-actions{padding-left:160px;}
+.btn{display:inline-block;*display:inline;*zoom:1;padding:4px 10px 4px;margin-bottom:0;font-size:13px;line-height:18px;*line-height:20px;color:#333333;text-align:center;text-shadow:0 1px 1px rgba(255, 255, 255, 0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;background-image:-moz-linear-gradient(top, #ffffff, #e6e6e6);background-image:-ms-linear-gradient(top, #ffffff, #e6e6e6);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#e6e6e6));background-image:-webkit-linear-gradient(top, #ffffff, #e6e6e6);background-image:-o-linear-gradient(top, #ffffff, #e6e6e6);background-image:linear-gradient(top, #ffffff, #e6e6e6);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#e6e6e6', GradientType=0);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#e6e6e6;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);border:1px solid #cccccc;*border:0;border-bottom-color:#b3b3b3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*margin-left:.3em;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{background-color:#e6e6e6;*background-color:#d9d9d9;}
+.btn:active,.btn.active{background-color:#cccccc \9;}
+.btn:first-child{*margin-left:0;}
+.btn:hover{color:#333333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position 0.1s linear;-moz-transition:background-position 0.1s linear;-ms-transition:background-position 0.1s linear;-o-transition:background-position 0.1s linear;transition:background-position 0.1s linear;}
+.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px;}
+.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}
+.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:0.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;}
+.btn-large{padding:9px 14px;font-size:15px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
+.btn-large [class^="icon-"]{margin-top:1px;}
+.btn-small{padding:5px 9px;font-size:11px;line-height:16px;}
+.btn-small [class^="icon-"]{margin-top:-1px;}
+.btn-mini{padding:2px 6px;font-size:11px;line-height:14px;}
+.btn-primary,.btn-primary:hover,.btn-warning,.btn-warning:hover,.btn-danger,.btn-danger:hover,.btn-success,.btn-success:hover,.btn-info,.btn-info:hover,.btn-inverse,.btn-inverse:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}
+.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255, 255, 255, 0.75);}
+.btn{border-color:#ccc;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);}
+.btn-primary{background-color:#0074cc;background-image:-moz-linear-gradient(top, #0088cc, #0055cc);background-image:-ms-linear-gradient(top, #0088cc, #0055cc);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0055cc));background-image:-webkit-linear-gradient(top, #0088cc, #0055cc);background-image:-o-linear-gradient(top, #0088cc, #0055cc);background-image:linear-gradient(top, #0088cc, #0055cc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0055cc', GradientType=0);border-color:#0055cc #0055cc #003580;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#0055cc;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{background-color:#0055cc;*background-color:#004ab3;}
+.btn-primary:active,.btn-primary.active{background-color:#004099 \9;}
+.btn-warning{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);border-color:#f89406 #f89406 #ad6704;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#f89406;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{background-color:#f89406;*background-color:#df8505;}
+.btn-warning:active,.btn-warning.active{background-color:#c67605 \9;}
+.btn-danger{background-color:#da4f49;background-image:-moz-linear-gradient(top, #ee5f5b, #bd362f);background-image:-ms-linear-gradient(top, #ee5f5b, #bd362f);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#bd362f));background-image:-webkit-linear-gradient(top, #ee5f5b, #bd362f);background-image:-o-linear-gradient(top, #ee5f5b, #bd362f);background-image:linear-gradient(top, #ee5f5b, #bd362f);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#bd362f', GradientType=0);border-color:#bd362f #bd362f #802420;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#bd362f;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{background-color:#bd362f;*background-color:#a9302a;}
+.btn-danger:active,.btn-danger.active{background-color:#942a25 \9;}
+.btn-success{background-color:#5bb75b;background-image:-moz-linear-gradient(top, #62c462, #51a351);background-image:-ms-linear-gradient(top, #62c462, #51a351);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#51a351));background-image:-webkit-linear-gradient(top, #62c462, #51a351);background-image:-o-linear-gradient(top, #62c462, #51a351);background-image:linear-gradient(top, #62c462, #51a351);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#51a351', GradientType=0);border-color:#51a351 #51a351 #387038;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#51a351;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{background-color:#51a351;*background-color:#499249;}
+.btn-success:active,.btn-success.active{background-color:#408140 \9;}
+.btn-info{background-color:#49afcd;background-image:-moz-linear-gradient(top, #5bc0de, #2f96b4);background-image:-ms-linear-gradient(top, #5bc0de, #2f96b4);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#2f96b4));background-image:-webkit-linear-gradient(top, #5bc0de, #2f96b4);background-image:-o-linear-gradient(top, #5bc0de, #2f96b4);background-image:linear-gradient(top, #5bc0de, #2f96b4);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#2f96b4', GradientType=0);border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#2f96b4;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{background-color:#2f96b4;*background-color:#2a85a0;}
+.btn-info:active,.btn-info.active{background-color:#24748c \9;}
+.btn-inverse{background-color:#414141;background-image:-moz-linear-gradient(top, #555555, #222222);background-image:-ms-linear-gradient(top, #555555, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#555555), to(#222222));background-image:-webkit-linear-gradient(top, #555555, #222222);background-image:-o-linear-gradient(top, #555555, #222222);background-image:linear-gradient(top, #555555, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{background-color:#222222;*background-color:#151515;}
+.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9;}
+button.btn,input[type="submit"].btn{*padding-top:2px;*padding-bottom:2px;}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0;}
+button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px;}
+button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px;}
+button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px;}
+[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;}
+.icon-white{background-image:url("../img/glyphicons-halflings-white.png");}
+.icon-glass{background-position:0 0;}
+.icon-music{background-position:-24px 0;}
+.icon-search{background-position:-48px 0;}
+.icon-envelope{background-position:-72px 0;}
+.icon-heart{background-position:-96px 0;}
+.icon-star{background-position:-120px 0;}
+.icon-star-empty{background-position:-144px 0;}
+.icon-user{background-position:-168px 0;}
+.icon-film{background-position:-192px 0;}
+.icon-th-large{background-position:-216px 0;}
+.icon-th{background-position:-240px 0;}
+.icon-th-list{background-position:-264px 0;}
+.icon-ok{background-position:-288px 0;}
+.icon-remove{background-position:-312px 0;}
+.icon-zoom-in{background-position:-336px 0;}
+.icon-zoom-out{background-position:-360px 0;}
+.icon-off{background-position:-384px 0;}
+.icon-signal{background-position:-408px 0;}
+.icon-cog{background-position:-432px 0;}
+.icon-trash{background-position:-456px 0;}
+.icon-home{background-position:0 -24px;}
+.icon-file{background-position:-24px -24px;}
+.icon-time{background-position:-48px -24px;}
+.icon-road{background-position:-72px -24px;}
+.icon-download-alt{background-position:-96px -24px;}
+.icon-download{background-position:-120px -24px;}
+.icon-upload{background-position:-144px -24px;}
+.icon-inbox{background-position:-168px -24px;}
+.icon-play-circle{background-position:-192px -24px;}
+.icon-repeat{background-position:-216px -24px;}
+.icon-refresh{background-position:-240px -24px;}
+.icon-list-alt{background-position:-264px -24px;}
+.icon-lock{background-position:-287px -24px;}
+.icon-flag{background-position:-312px -24px;}
+.icon-headphones{background-position:-336px -24px;}
+.icon-volume-off{background-position:-360px -24px;}
+.icon-volume-down{background-position:-384px -24px;}
+.icon-volume-up{background-position:-408px -24px;}
+.icon-qrcode{background-position:-432px -24px;}
+.icon-barcode{background-position:-456px -24px;}
+.icon-tag{background-position:0 -48px;}
+.icon-tags{background-position:-25px -48px;}
+.icon-book{background-position:-48px -48px;}
+.icon-bookmark{background-position:-72px -48px;}
+.icon-print{background-position:-96px -48px;}
+.icon-camera{background-position:-120px -48px;}
+.icon-font{background-position:-144px -48px;}
+.icon-bold{background-position:-167px -48px;}
+.icon-italic{background-position:-192px -48px;}
+.icon-text-height{background-position:-216px -48px;}
+.icon-text-width{background-position:-240px -48px;}
+.icon-align-left{background-position:-264px -48px;}
+.icon-align-center{background-position:-288px -48px;}
+.icon-align-right{background-position:-312px -48px;}
+.icon-align-justify{background-position:-336px -48px;}
+.icon-list{background-position:-360px -48px;}
+.icon-indent-left{background-position:-384px -48px;}
+.icon-indent-right{background-position:-408px -48px;}
+.icon-facetime-video{background-position:-432px -48px;}
+.icon-picture{background-position:-456px -48px;}
+.icon-pencil{background-position:0 -72px;}
+.icon-map-marker{background-position:-24px -72px;}
+.icon-adjust{background-position:-48px -72px;}
+.icon-tint{background-position:-72px -72px;}
+.icon-edit{background-position:-96px -72px;}
+.icon-share{background-position:-120px -72px;}
+.icon-check{background-position:-144px -72px;}
+.icon-move{background-position:-168px -72px;}
+.icon-step-backward{background-position:-192px -72px;}
+.icon-fast-backward{background-position:-216px -72px;}
+.icon-backward{background-position:-240px -72px;}
+.icon-play{background-position:-264px -72px;}
+.icon-pause{background-position:-288px -72px;}
+.icon-stop{background-position:-312px -72px;}
+.icon-forward{background-position:-336px -72px;}
+.icon-fast-forward{background-position:-360px -72px;}
+.icon-step-forward{background-position:-384px -72px;}
+.icon-eject{background-position:-408px -72px;}
+.icon-chevron-left{background-position:-432px -72px;}
+.icon-chevron-right{background-position:-456px -72px;}
+.icon-plus-sign{background-position:0 -96px;}
+.icon-minus-sign{background-position:-24px -96px;}
+.icon-remove-sign{background-position:-48px -96px;}
+.icon-ok-sign{background-position:-72px -96px;}
+.icon-question-sign{background-position:-96px -96px;}
+.icon-info-sign{background-position:-120px -96px;}
+.icon-screenshot{background-position:-144px -96px;}
+.icon-remove-circle{background-position:-168px -96px;}
+.icon-ok-circle{background-position:-192px -96px;}
+.icon-ban-circle{background-position:-216px -96px;}
+.icon-arrow-left{background-position:-240px -96px;}
+.icon-arrow-right{background-position:-264px -96px;}
+.icon-arrow-up{background-position:-289px -96px;}
+.icon-arrow-down{background-position:-312px -96px;}
+.icon-share-alt{background-position:-336px -96px;}
+.icon-resize-full{background-position:-360px -96px;}
+.icon-resize-small{background-position:-384px -96px;}
+.icon-plus{background-position:-408px -96px;}
+.icon-minus{background-position:-433px -96px;}
+.icon-asterisk{background-position:-456px -96px;}
+.icon-exclamation-sign{background-position:0 -120px;}
+.icon-gift{background-position:-24px -120px;}
+.icon-leaf{background-position:-48px -120px;}
+.icon-fire{background-position:-72px -120px;}
+.icon-eye-open{background-position:-96px -120px;}
+.icon-eye-close{background-position:-120px -120px;}
+.icon-warning-sign{background-position:-144px -120px;}
+.icon-plane{background-position:-168px -120px;}
+.icon-calendar{background-position:-192px -120px;}
+.icon-random{background-position:-216px -120px;}
+.icon-comment{background-position:-240px -120px;}
+.icon-magnet{background-position:-264px -120px;}
+.icon-chevron-up{background-position:-288px -120px;}
+.icon-chevron-down{background-position:-313px -119px;}
+.icon-retweet{background-position:-336px -120px;}
+.icon-shopping-cart{background-position:-360px -120px;}
+.icon-folder-close{background-position:-384px -120px;}
+.icon-folder-open{background-position:-408px -120px;}
+.icon-resize-vertical{background-position:-432px -119px;}
+.icon-resize-horizontal{background-position:-456px -118px;}
+.icon-hdd{background-position:0 -144px;}
+.icon-bullhorn{background-position:-24px -144px;}
+.icon-bell{background-position:-48px -144px;}
+.icon-certificate{background-position:-72px -144px;}
+.icon-thumbs-up{background-position:-96px -144px;}
+.icon-thumbs-down{background-position:-120px -144px;}
+.icon-hand-right{background-position:-144px -144px;}
+.icon-hand-left{background-position:-168px -144px;}
+.icon-hand-up{background-position:-192px -144px;}
+.icon-hand-down{background-position:-216px -144px;}
+.icon-circle-arrow-right{background-position:-240px -144px;}
+.icon-circle-arrow-left{background-position:-264px -144px;}
+.icon-circle-arrow-up{background-position:-288px -144px;}
+.icon-circle-arrow-down{background-position:-312px -144px;}
+.icon-globe{background-position:-336px -144px;}
+.icon-wrench{background-position:-360px -144px;}
+.icon-tasks{background-position:-384px -144px;}
+.icon-filter{background-position:-408px -144px;}
+.icon-briefcase{background-position:-432px -144px;}
+.icon-fullscreen{background-position:-456px -144px;}
+.btn-group{position:relative;*zoom:1;*margin-left:.3em;}.btn-group:before,.btn-group:after{display:table;content:"";}
+.btn-group:after{clear:both;}
+.btn-group:first-child{*margin-left:0;}
+.btn-group+.btn-group{margin-left:5px;}
+.btn-toolbar{margin-top:9px;margin-bottom:9px;}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1;}
+.btn-group>.btn{position:relative;float:left;margin-left:-1px;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
+.btn-group>.btn:first-child{margin-left:0;-webkit-border-top-left-radius:4px;-moz-border-radius-topleft:4px;border-top-left-radius:4px;-webkit-border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px;border-bottom-left-radius:4px;}
+.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;-moz-border-radius-topright:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px;border-bottom-right-radius:4px;}
+.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-top-left-radius:6px;-moz-border-radius-topleft:6px;border-top-left-radius:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomleft:6px;border-bottom-left-radius:6px;}
+.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;-moz-border-radius-topright:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;-moz-border-radius-bottomright:6px;border-bottom-right-radius:6px;}
+.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2;}
+.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0;}
+.btn-group>.dropdown-toggle{padding-left:8px;padding-right:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 1px 0 0 rgba(255,255,255,.125), inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05);*padding-top:4px;*padding-bottom:4px;}
+.btn-group>.btn-mini.dropdown-toggle{padding-left:5px;padding-right:5px;}
+.btn-group>.btn-small.dropdown-toggle{*padding-top:4px;*padding-bottom:4px;}
+.btn-group>.btn-large.dropdown-toggle{padding-left:12px;padding-right:12px;}
+.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);box-shadow:inset 0 2px 4px rgba(0,0,0,.15), 0 1px 2px rgba(0,0,0,.05);}
+.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6;}
+.btn-group.open .btn-primary.dropdown-toggle{background-color:#0055cc;}
+.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406;}
+.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f;}
+.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351;}
+.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4;}
+.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222222;}
+.btn .caret{margin-top:7px;margin-left:0;}
+.btn:hover .caret,.open.btn-group .caret{opacity:1;filter:alpha(opacity=100);}
+.btn-mini .caret{margin-top:5px;}
+.btn-small .caret{margin-top:6px;}
+.btn-large .caret{margin-top:6px;border-left-width:5px;border-right-width:5px;border-top-width:5px;}
+.dropup .btn-large .caret{border-bottom:5px solid #000000;border-top:0;}
+.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:0.75;filter:alpha(opacity=75);}
+.nav{margin-left:0;margin-bottom:18px;list-style:none;}
+.nav>li>a{display:block;}
+.nav>li>a:hover{text-decoration:none;background-color:#eeeeee;}
+.nav>.pull-right{float:right;}
+.nav .nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:18px;color:#999999;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);text-transform:uppercase;}
+.nav li+.nav-header{margin-top:9px;}
+.nav-list{padding-left:15px;padding-right:15px;margin-bottom:0;}
+.nav-list>li>a,.nav-list .nav-header{margin-left:-15px;margin-right:-15px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);}
+.nav-list>li>a{padding:3px 15px;}
+.nav-list>.active>a,.nav-list>.active>a:hover{color:#ffffff;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.2);background-color:#0088cc;}
+.nav-list [class^="icon-"]{margin-right:2px;}
+.nav-list .divider{*width:100%;height:1px;margin:8px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;}
+.nav-tabs,.nav-pills{*zoom:1;}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;content:"";}
+.nav-tabs:after,.nav-pills:after{clear:both;}
+.nav-tabs>li,.nav-pills>li{float:left;}
+.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px;}
+.nav-tabs{border-bottom:1px solid #ddd;}
+.nav-tabs>li{margin-bottom:-1px;}
+.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:18px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #dddddd;}
+.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555555;background-color:#ffffff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default;}
+.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;}
+.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#ffffff;background-color:#0088cc;}
+.nav-stacked>li{float:none;}
+.nav-stacked>li>a{margin-right:0;}
+.nav-tabs.nav-stacked{border-bottom:0;}
+.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
+.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0;}
+.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}
+.nav-tabs.nav-stacked>li>a:hover{border-color:#ddd;z-index:2;}
+.nav-pills.nav-stacked>li>a{margin-bottom:3px;}
+.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px;}
+.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 5px 5px;-moz-border-radius:0 0 5px 5px;border-radius:0 0 5px 5px;}
+.nav-pills .dropdown-menu{-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.nav-tabs .dropdown-toggle .caret,.nav-pills .dropdown-toggle .caret{border-top-color:#0088cc;border-bottom-color:#0088cc;margin-top:6px;}
+.nav-tabs .dropdown-toggle:hover .caret,.nav-pills .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580;}
+.nav-tabs .active .dropdown-toggle .caret,.nav-pills .active .dropdown-toggle .caret{border-top-color:#333333;border-bottom-color:#333333;}
+.nav>.dropdown.active>a:hover{color:#000000;cursor:pointer;}
+.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#ffffff;background-color:#999999;border-color:#999999;}
+.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;opacity:1;filter:alpha(opacity=100);}
+.tabs-stacked .open>a:hover{border-color:#999999;}
+.tabbable{*zoom:1;}.tabbable:before,.tabbable:after{display:table;content:"";}
+.tabbable:after{clear:both;}
+.tab-content{overflow:auto;}
+.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0;}
+.tab-content>.tab-pane,.pill-content>.pill-pane{display:none;}
+.tab-content>.active,.pill-content>.active{display:block;}
+.tabs-below>.nav-tabs{border-top:1px solid #ddd;}
+.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0;}
+.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px;}.tabs-below>.nav-tabs>li>a:hover{border-bottom-color:transparent;border-top-color:#ddd;}
+.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd;}
+.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none;}
+.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px;}
+.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd;}
+.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px;}
+.tabs-left>.nav-tabs>li>a:hover{border-color:#eeeeee #dddddd #eeeeee #eeeeee;}
+.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#ffffff;}
+.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd;}
+.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0;}
+.tabs-right>.nav-tabs>li>a:hover{border-color:#eeeeee #eeeeee #eeeeee #dddddd;}
+.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#ffffff;}
+.navbar{*position:relative;*z-index:2;overflow:visible;margin-bottom:18px;}
+.navbar-inner{min-height:40px;padding-left:20px;padding-right:20px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);box-shadow:0 1px 3px rgba(0,0,0,.25), inset 0 -1px 0 rgba(0,0,0,.1);}
+.navbar .container{width:auto;}
+.nav-collapse.collapse{height:auto;}
+.navbar{color:#999999;}.navbar .brand:hover{text-decoration:none;}
+.navbar .brand{float:left;display:block;padding:8px 20px 12px;margin-left:-20px;font-size:20px;font-weight:200;line-height:1;color:#999999;}
+.navbar .navbar-text{margin-bottom:0;line-height:40px;}
+.navbar .navbar-link{color:#999999;}.navbar .navbar-link:hover{color:#ffffff;}
+.navbar .btn,.navbar .btn-group{margin-top:5px;}
+.navbar .btn-group .btn{margin:0;}
+.navbar-form{margin-bottom:0;*zoom:1;}.navbar-form:before,.navbar-form:after{display:table;content:"";}
+.navbar-form:after{clear:both;}
+.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px;}
+.navbar-form input,.navbar-form select{display:inline-block;margin-bottom:0;}
+.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px;}
+.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap;}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0;}
+.navbar-search{position:relative;float:left;margin-top:6px;margin-bottom:0;}.navbar-search .search-query{padding:4px 9px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;color:#ffffff;background-color:#626262;border:1px solid #151515;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);box-shadow:inset 0 1px 2px rgba(0,0,0,.1), 0 1px 0 rgba(255,255,255,.15);-webkit-transition:none;-moz-transition:none;-ms-transition:none;-o-transition:none;transition:none;}.navbar-search .search-query:-moz-placeholder{color:#cccccc;}
+.navbar-search .search-query:-ms-input-placeholder{color:#cccccc;}
+.navbar-search .search-query::-webkit-input-placeholder{color:#cccccc;}
+.navbar-search .search-query:focus,.navbar-search .search-query.focused{padding:5px 10px;color:#333333;text-shadow:0 1px 0 #ffffff;background-color:#ffffff;border:0;-webkit-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);-moz-box-shadow:0 0 3px rgba(0, 0, 0, 0.15);box-shadow:0 0 3px rgba(0, 0, 0, 0.15);outline:0;}
+.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0;}
+.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-left:0;padding-right:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;}
+.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}
+.navbar-fixed-top{top:0;}
+.navbar-fixed-bottom{bottom:0;}
+.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0;}
+.navbar .nav.pull-right{float:right;}
+.navbar .nav>li{display:block;float:left;}
+.navbar .nav>li>a{float:none;padding:9px 10px 11px;line-height:19px;color:#999999;text-decoration:none;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);}
+.navbar .btn{display:inline-block;padding:4px 10px 4px;margin:5px 5px 6px;line-height:18px;}
+.navbar .btn-group{margin:0;padding:5px 5px 6px;}
+.navbar .nav>li>a:hover{background-color:transparent;color:#ffffff;text-decoration:none;}
+.navbar .nav .active>a,.navbar .nav .active>a:hover{color:#ffffff;text-decoration:none;background-color:#222222;}
+.navbar .divider-vertical{height:40px;width:1px;margin:0 9px;overflow:hidden;background-color:#222222;border-right:1px solid #333333;}
+.navbar .nav.pull-right{margin-left:10px;margin-right:0;}
+.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-left:5px;margin-right:5px;background-color:#2c2c2c;background-image:-moz-linear-gradient(top, #333333, #222222);background-image:-ms-linear-gradient(top, #333333, #222222);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#333333), to(#222222));background-image:-webkit-linear-gradient(top, #333333, #222222);background-image:-o-linear-gradient(top, #333333, #222222);background-image:linear-gradient(top, #333333, #222222);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#333333', endColorstr='#222222', GradientType=0);border-color:#222222 #222222 #000000;border-color:rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);*background-color:#222222;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.075);}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{background-color:#222222;*background-color:#151515;}
+.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#080808 \9;}
+.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);-moz-box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);box-shadow:0 1px 0 rgba(0, 0, 0, 0.25);}
+.btn-navbar .icon-bar+.icon-bar{margin-top:3px;}
+.navbar .dropdown-menu:before{content:'';display:inline-block;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-bottom-color:rgba(0, 0, 0, 0.2);position:absolute;top:-7px;left:9px;}
+.navbar .dropdown-menu:after{content:'';display:inline-block;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:6px solid #ffffff;position:absolute;top:-6px;left:10px;}
+.navbar-fixed-bottom .dropdown-menu:before{border-top:7px solid #ccc;border-top-color:rgba(0, 0, 0, 0.2);border-bottom:0;bottom:-7px;top:auto;}
+.navbar-fixed-bottom .dropdown-menu:after{border-top:6px solid #ffffff;border-bottom:0;bottom:-6px;top:auto;}
+.navbar .nav li.dropdown .dropdown-toggle .caret,.navbar .nav li.dropdown.open .caret{border-top-color:#ffffff;border-bottom-color:#ffffff;}
+.navbar .nav li.dropdown.active .caret{opacity:1;filter:alpha(opacity=100);}
+.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{background-color:transparent;}
+.navbar .nav li.dropdown.active>.dropdown-toggle:hover{color:#ffffff;}
+.navbar .pull-right .dropdown-menu,.navbar .dropdown-menu.pull-right{left:auto;right:0;}.navbar .pull-right .dropdown-menu:before,.navbar .dropdown-menu.pull-right:before{left:auto;right:12px;}
+.navbar .pull-right .dropdown-menu:after,.navbar .dropdown-menu.pull-right:after{left:auto;right:13px;}
+.breadcrumb{padding:7px 14px;margin:0 0 18px;list-style:none;background-color:#fbfbfb;background-image:-moz-linear-gradient(top, #ffffff, #f5f5f5);background-image:-ms-linear-gradient(top, #ffffff, #f5f5f5);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ffffff), to(#f5f5f5));background-image:-webkit-linear-gradient(top, #ffffff, #f5f5f5);background-image:-o-linear-gradient(top, #ffffff, #f5f5f5);background-image:linear-gradient(top, #ffffff, #f5f5f5);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f5f5f5', GradientType=0);border:1px solid #ddd;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;}.breadcrumb li{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 0 #ffffff;}
+.breadcrumb .divider{padding:0 5px;color:#999999;}
+.breadcrumb .active a{color:#333333;}
+.pagination{height:36px;margin:18px 0;}
+.pagination ul{display:inline-block;*display:inline;*zoom:1;margin-left:0;margin-bottom:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:0 1px 2px rgba(0, 0, 0, 0.05);}
+.pagination li{display:inline;}
+.pagination a{float:left;padding:0 14px;line-height:34px;text-decoration:none;border:1px solid #ddd;border-left-width:0;}
+.pagination a:hover,.pagination .active a{background-color:#f5f5f5;}
+.pagination .active a{color:#999999;cursor:default;}
+.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999999;background-color:transparent;cursor:default;}
+.pagination li:first-child a{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px;}
+.pagination li:last-child a{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0;}
+.pagination-centered{text-align:center;}
+.pagination-right{text-align:right;}
+.pager{margin-left:0;margin-bottom:18px;list-style:none;text-align:center;*zoom:1;}.pager:before,.pager:after{display:table;content:"";}
+.pager:after{clear:both;}
+.pager li{display:inline;}
+.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px;}
+.pager a:hover{text-decoration:none;background-color:#f5f5f5;}
+.pager .next a{float:right;}
+.pager .previous a{float:left;}
+.pager .disabled a,.pager .disabled a:hover{color:#999999;background-color:#fff;cursor:default;}
+.thumbnails{margin-left:-20px;list-style:none;*zoom:1;}.thumbnails:before,.thumbnails:after{display:table;content:"";}
+.thumbnails:after{clear:both;}
+.row-fluid .thumbnails{margin-left:0;}
+.thumbnails>li{float:left;margin-bottom:18px;margin-left:20px;}
+.thumbnail{display:block;padding:4px;line-height:1;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:0 1px 1px rgba(0, 0, 0, 0.075);}
+a.thumbnail:hover{border-color:#0088cc;-webkit-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);-moz-box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);box-shadow:0 1px 4px rgba(0, 105, 214, 0.25);}
+.thumbnail>img{display:block;max-width:100%;margin-left:auto;margin-right:auto;}
+.thumbnail .caption{padding:9px;}
+.alert{padding:8px 35px 8px 14px;margin-bottom:18px;text-shadow:0 1px 0 rgba(255, 255, 255, 0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;color:#c09853;}
+.alert-heading{color:inherit;}
+.alert .close{position:relative;top:-2px;right:-21px;line-height:18px;}
+.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#468847;}
+.alert-danger,.alert-error{background-color:#f2dede;border-color:#eed3d7;color:#b94a48;}
+.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#3a87ad;}
+.alert-block{padding-top:14px;padding-bottom:14px;}
+.alert-block>p,.alert-block>ul{margin-bottom:0;}
+.alert-block p+p{margin-top:5px;}
+@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}@-o-keyframes progress-bar-stripes{from{background-position:0 0;} to{background-position:40px 0;}}@keyframes progress-bar-stripes{from{background-position:40px 0;} to{background-position:0 0;}}.progress{overflow:hidden;height:18px;margin-bottom:18px;background-color:#f7f7f7;background-image:-moz-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-ms-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#f5f5f5), to(#f9f9f9));background-image:-webkit-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:-o-linear-gradient(top, #f5f5f5, #f9f9f9);background-image:linear-gradient(top, #f5f5f5, #f9f9f9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5', endColorstr='#f9f9f9', GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-moz-box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);box-shadow:inset 0 1px 2px rgba(0, 0, 0, 0.1);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.progress .bar{width:0%;height:18px;color:#ffffff;font-size:12px;text-align:center;text-shadow:0 -1px 0 rgba(0, 0, 0, 0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top, #149bdf, #0480be);background-image:-ms-linear-gradient(top, #149bdf, #0480be);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#149bdf), to(#0480be));background-image:-webkit-linear-gradient(top, #149bdf, #0480be);background-image:-o-linear-gradient(top, #149bdf, #0480be);background-image:linear-gradient(top, #149bdf, #0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#149bdf', endColorstr='#0480be', GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);box-shadow:inset 0 -1px 0 rgba(0, 0, 0, 0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width 0.6s ease;-moz-transition:width 0.6s ease;-ms-transition:width 0.6s ease;-o-transition:width 0.6s ease;transition:width 0.6s ease;}
+.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px;}
+.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite;}
+.progress-danger .bar{background-color:#dd514c;background-image:-moz-linear-gradient(top, #ee5f5b, #c43c35);background-image:-ms-linear-gradient(top, #ee5f5b, #c43c35);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#ee5f5b), to(#c43c35));background-image:-webkit-linear-gradient(top, #ee5f5b, #c43c35);background-image:-o-linear-gradient(top, #ee5f5b, #c43c35);background-image:linear-gradient(top, #ee5f5b, #c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b', endColorstr='#c43c35', GradientType=0);}
+.progress-danger.progress-striped .bar{background-color:#ee5f5b;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
+.progress-success .bar{background-color:#5eb95e;background-image:-moz-linear-gradient(top, #62c462, #57a957);background-image:-ms-linear-gradient(top, #62c462, #57a957);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#62c462), to(#57a957));background-image:-webkit-linear-gradient(top, #62c462, #57a957);background-image:-o-linear-gradient(top, #62c462, #57a957);background-image:linear-gradient(top, #62c462, #57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462', endColorstr='#57a957', GradientType=0);}
+.progress-success.progress-striped .bar{background-color:#62c462;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
+.progress-info .bar{background-color:#4bb1cf;background-image:-moz-linear-gradient(top, #5bc0de, #339bb9);background-image:-ms-linear-gradient(top, #5bc0de, #339bb9);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#5bc0de), to(#339bb9));background-image:-webkit-linear-gradient(top, #5bc0de, #339bb9);background-image:-o-linear-gradient(top, #5bc0de, #339bb9);background-image:linear-gradient(top, #5bc0de, #339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de', endColorstr='#339bb9', GradientType=0);}
+.progress-info.progress-striped .bar{background-color:#5bc0de;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
+.progress-warning .bar{background-color:#faa732;background-image:-moz-linear-gradient(top, #fbb450, #f89406);background-image:-ms-linear-gradient(top, #fbb450, #f89406);background-image:-webkit-gradient(linear, 0 0, 0 100%, from(#fbb450), to(#f89406));background-image:-webkit-linear-gradient(top, #fbb450, #f89406);background-image:-o-linear-gradient(top, #fbb450, #f89406);background-image:linear-gradient(top, #fbb450, #f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fbb450', endColorstr='#f89406', GradientType=0);}
+.progress-warning.progress-striped .bar{background-color:#fbb450;background-image:-webkit-gradient(linear, 0 100%, 100% 0, color-stop(0.25, rgba(255, 255, 255, 0.15)), color-stop(0.25, transparent), color-stop(0.5, transparent), color-stop(0.5, rgba(255, 255, 255, 0.15)), color-stop(0.75, rgba(255, 255, 255, 0.15)), color-stop(0.75, transparent), to(transparent));background-image:-webkit-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-moz-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-ms-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);}
+.hero-unit{padding:60px;margin-bottom:30px;background-color:#eeeeee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;color:inherit;letter-spacing:-1px;}
+.hero-unit p{font-size:18px;font-weight:200;line-height:27px;color:inherit;}
+.tooltip{position:absolute;z-index:1020;display:block;visibility:visible;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);}.tooltip.in{opacity:0.8;filter:alpha(opacity=80);}
+.tooltip.top{margin-top:-2px;}
+.tooltip.right{margin-left:2px;}
+.tooltip.bottom{margin-top:2px;}
+.tooltip.left{margin-left:-2px;}
+.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
+.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
+.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
+.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
+.tooltip-inner{max-width:200px;padding:3px 8px;color:#ffffff;text-align:center;text-decoration:none;background-color:#000000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.tooltip-arrow{position:absolute;width:0;height:0;}
+.popover{position:absolute;top:0;left:0;z-index:1010;display:none;padding:5px;}.popover.top{margin-top:-5px;}
+.popover.right{margin-left:5px;}
+.popover.bottom{margin-top:5px;}
+.popover.left{margin-left:-5px;}
+.popover.top .arrow{bottom:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-top:5px solid #000000;}
+.popover.right .arrow{top:50%;left:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-right:5px solid #000000;}
+.popover.bottom .arrow{top:0;left:50%;margin-left:-5px;border-left:5px solid transparent;border-right:5px solid transparent;border-bottom:5px solid #000000;}
+.popover.left .arrow{top:50%;right:0;margin-top:-5px;border-top:5px solid transparent;border-bottom:5px solid transparent;border-left:5px solid #000000;}
+.popover .arrow{position:absolute;width:0;height:0;}
+.popover-inner{padding:3px;width:280px;overflow:hidden;background:#000000;background:rgba(0, 0, 0, 0.8);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);}
+.popover-title{padding:9px 15px;line-height:1;background-color:#f5f5f5;border-bottom:1px solid #eee;-webkit-border-radius:3px 3px 0 0;-moz-border-radius:3px 3px 0 0;border-radius:3px 3px 0 0;}
+.popover-content{padding:14px;background-color:#ffffff;-webkit-border-radius:0 0 3px 3px;-moz-border-radius:0 0 3px 3px;border-radius:0 0 3px 3px;-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0;}
+.modal-open .dropdown-menu{z-index:2050;}
+.modal-open .dropdown.open{*z-index:2050;}
+.modal-open .popover{z-index:2060;}
+.modal-open .tooltip{z-index:2070;}
+.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000000;}.modal-backdrop.fade{opacity:0;}
+.modal-backdrop,.modal-backdrop.fade.in{opacity:0.8;filter:alpha(opacity=80);}
+.modal{position:fixed;top:50%;left:50%;z-index:1050;overflow:auto;width:560px;margin:-250px 0 0 -280px;background-color:#ffffff;border:1px solid #999;border:1px solid rgba(0, 0, 0, 0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box;}.modal.fade{-webkit-transition:opacity .3s linear, top .3s ease-out;-moz-transition:opacity .3s linear, top .3s ease-out;-ms-transition:opacity .3s linear, top .3s ease-out;-o-transition:opacity .3s linear, top .3s ease-out;transition:opacity .3s linear, top .3s ease-out;top:-25%;}
+.modal.fade.in{top:50%;}
+.modal-header{padding:9px 15px;border-bottom:1px solid #eee;}.modal-header .close{margin-top:2px;}
+.modal-body{overflow-y:auto;max-height:400px;padding:15px;}
+.modal-form{margin-bottom:0;}
+.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;-webkit-box-shadow:inset 0 1px 0 #ffffff;-moz-box-shadow:inset 0 1px 0 #ffffff;box-shadow:inset 0 1px 0 #ffffff;*zoom:1;}.modal-footer:before,.modal-footer:after{display:table;content:"";}
+.modal-footer:after{clear:both;}
+.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0;}
+.modal-footer .btn-group .btn+.btn{margin-left:-1px;}
+.dropup,.dropdown{position:relative;}
+.dropdown-toggle{*margin-bottom:-3px;}
+.dropdown-toggle:active,.open .dropdown-toggle{outline:0;}
+.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000000;border-right:4px solid transparent;border-left:4px solid transparent;content:"";opacity:0.3;filter:alpha(opacity=30);}
+.dropdown .caret{margin-top:8px;margin-left:2px;}
+.dropdown:hover .caret,.open .caret{opacity:1;filter:alpha(opacity=100);}
+.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:4px 0;margin:1px 0 0;list-style:none;background-color:#ffffff;border:1px solid #ccc;border:1px solid rgba(0, 0, 0, 0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;}.dropdown-menu.pull-right{right:0;left:auto;}
+.dropdown-menu .divider{*width:100%;height:1px;margin:8px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #ffffff;}
+.dropdown-menu a{display:block;padding:3px 15px;clear:both;font-weight:normal;line-height:18px;color:#333333;white-space:nowrap;}
+.dropdown-menu li>a:hover,.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#ffffff;text-decoration:none;background-color:#0088cc;}
+.open{*z-index:1000;}.open >.dropdown-menu{display:block;}
+.pull-right>.dropdown-menu{right:0;left:auto;}
+.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000000;content:"\2191";}
+.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px;}
+.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.accordion{margin-bottom:18px;}
+.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}
+.accordion-heading{border-bottom:0;}
+.accordion-heading .accordion-toggle{display:block;padding:8px 15px;}
+.accordion-toggle{cursor:pointer;}
+.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5;}
+.carousel{position:relative;margin-bottom:18px;line-height:1;}
+.carousel-inner{overflow:hidden;width:100%;position:relative;}
+.carousel .item{display:none;position:relative;-webkit-transition:0.6s ease-in-out left;-moz-transition:0.6s ease-in-out left;-ms-transition:0.6s ease-in-out left;-o-transition:0.6s ease-in-out left;transition:0.6s ease-in-out left;}
+.carousel .item>img{display:block;line-height:1;}
+.carousel .active,.carousel .next,.carousel .prev{display:block;}
+.carousel .active{left:0;}
+.carousel .next,.carousel .prev{position:absolute;top:0;width:100%;}
+.carousel .next{left:100%;}
+.carousel .prev{left:-100%;}
+.carousel .next.left,.carousel .prev.right{left:0;}
+.carousel .active.left{left:-100%;}
+.carousel .active.right{left:100%;}
+.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#ffffff;text-align:center;background:#222222;border:3px solid #ffffff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:0.5;filter:alpha(opacity=50);}.carousel-control.right{left:auto;right:15px;}
+.carousel-control:hover{color:#ffffff;text-decoration:none;opacity:0.9;filter:alpha(opacity=90);}
+.carousel-caption{position:absolute;left:0;right:0;bottom:0;padding:10px 15px 5px;background:#333333;background:rgba(0, 0, 0, 0.75);}
+.carousel-caption h4,.carousel-caption p{color:#ffffff;}
+.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #eee;border:1px solid rgba(0, 0, 0, 0.05);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.05);}.well blockquote{border-color:#ddd;border-color:rgba(0, 0, 0, 0.15);}
+.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;}
+.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}
+.close{float:right;font-size:20px;font-weight:bold;line-height:18px;color:#000000;text-shadow:0 1px 0 #ffffff;opacity:0.2;filter:alpha(opacity=20);}.close:hover{color:#000000;text-decoration:none;cursor:pointer;opacity:0.4;filter:alpha(opacity=40);}
+button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none;}
+.pull-right{float:right;}
+.pull-left{float:left;}
+.hide{display:none;}
+.show{display:block;}
+.invisible{visibility:hidden;}
+.fade{opacity:0;-webkit-transition:opacity 0.15s linear;-moz-transition:opacity 0.15s linear;-ms-transition:opacity 0.15s linear;-o-transition:opacity 0.15s linear;transition:opacity 0.15s linear;}.fade.in{opacity:1;}
+.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height 0.35s ease;-moz-transition:height 0.35s ease;-ms-transition:height 0.35s ease;-o-transition:height 0.35s ease;transition:height 0.35s ease;}.collapse.in{height:auto;}
+.hidden{display:none;visibility:hidden;}
+.visible-phone{display:none !important;}
+.visible-tablet{display:none !important;}
+.hidden-desktop{display:none !important;}
+@media (max-width:767px){.visible-phone{display:inherit !important;} .hidden-phone{display:none !important;} .hidden-desktop{display:inherit !important;} .visible-desktop{display:none !important;}}@media (min-width:768px) and (max-width:979px){.visible-tablet{display:inherit !important;} .hidden-tablet{display:none !important;} .hidden-desktop{display:inherit !important;} .visible-desktop{display:none !important ;}}@media (max-width:480px){.nav-collapse{-webkit-transform:translate3d(0, 0, 0);} .page-header h1 small{display:block;line-height:18px;} input[type="checkbox"],input[type="radio"]{border:1px solid #ccc;} .form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left;} .form-horizontal .controls{margin-left:0;} .form-horizontal .control-list{padding-top:0;} .form-horizontal .form-actions{padding-left:10px;padding-right:10px;} .modal{position:absolute;top:10px;left:10px;right:10px;width:auto;margin:0;}.modal.fade.in{top:auto;} .modal-header .close{padding:10px;margin:-10px;} .carousel-caption{position:static;}}@media (max-width:767px){body{padding-left:20px;padding-right:20px;} .navbar-fixed-top,.navbar-fixed-bottom{margin-left:-20px;margin-right:-20px;} .container-fluid{padding:0;} .dl-horizontal dt{float:none;clear:none;width:auto;text-align:left;} .dl-horizontal dd{margin-left:0;} .container{width:auto;} .row-fluid{width:100%;} .row,.thumbnails{margin-left:0;} [class*="span"],.row-fluid [class*="span"]{float:none;display:block;width:auto;margin-left:0;} .input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;} .input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto;}}@media (min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:"";} .row:after{clear:both;} [class*="span"]{float:left;margin-left:20px;} .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px;} .span12{width:724px;} .span11{width:662px;} .span10{width:600px;} .span9{width:538px;} .span8{width:476px;} .span7{width:414px;} .span6{width:352px;} .span5{width:290px;} .span4{width:228px;} .span3{width:166px;} .span2{width:104px;} .span1{width:42px;} .offset12{margin-left:764px;} .offset11{margin-left:702px;} .offset10{margin-left:640px;} .offset9{margin-left:578px;} .offset8{margin-left:516px;} .offset7{margin-left:454px;} .offset6{margin-left:392px;} .offset5{margin-left:330px;} .offset4{margin-left:268px;} .offset3{margin-left:206px;} .offset2{margin-left:144px;} .offset1{margin-left:82px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.762430939%;*margin-left:2.709239449638298%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:99.999999993%;*width:99.9468085036383%;} .row-fluid .span11{width:91.436464082%;*width:91.38327259263829%;} .row-fluid .span10{width:82.87292817100001%;*width:82.8197366816383%;} .row-fluid .span9{width:74.30939226%;*width:74.25620077063829%;} .row-fluid .span8{width:65.74585634900001%;*width:65.6926648596383%;} .row-fluid .span7{width:57.182320438000005%;*width:57.129128948638304%;} .row-fluid .span6{width:48.618784527%;*width:48.5655930376383%;} .row-fluid .span5{width:40.055248616%;*width:40.0020571266383%;} .row-fluid .span4{width:31.491712705%;*width:31.4385212156383%;} .row-fluid .span3{width:22.928176794%;*width:22.874985304638297%;} .row-fluid .span2{width:14.364640883%;*width:14.311449393638298%;} .row-fluid .span1{width:5.801104972%;*width:5.747913482638298%;} input,textarea,.uneditable-input{margin-left:0;} input.span12, textarea.span12, .uneditable-input.span12{width:714px;} input.span11, textarea.span11, .uneditable-input.span11{width:652px;} input.span10, textarea.span10, .uneditable-input.span10{width:590px;} input.span9, textarea.span9, .uneditable-input.span9{width:528px;} input.span8, textarea.span8, .uneditable-input.span8{width:466px;} input.span7, textarea.span7, .uneditable-input.span7{width:404px;} input.span6, textarea.span6, .uneditable-input.span6{width:342px;} input.span5, textarea.span5, .uneditable-input.span5{width:280px;} input.span4, textarea.span4, .uneditable-input.span4{width:218px;} input.span3, textarea.span3, .uneditable-input.span3{width:156px;} input.span2, textarea.span2, .uneditable-input.span2{width:94px;} input.span1, textarea.span1, .uneditable-input.span1{width:32px;}}@media (min-width:1200px){.row{margin-left:-30px;*zoom:1;}.row:before,.row:after{display:table;content:"";} .row:after{clear:both;} [class*="span"]{float:left;margin-left:30px;} .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px;} .span12{width:1170px;} .span11{width:1070px;} .span10{width:970px;} .span9{width:870px;} .span8{width:770px;} .span7{width:670px;} .span6{width:570px;} .span5{width:470px;} .span4{width:370px;} .span3{width:270px;} .span2{width:170px;} .span1{width:70px;} .offset12{margin-left:1230px;} .offset11{margin-left:1130px;} .offset10{margin-left:1030px;} .offset9{margin-left:930px;} .offset8{margin-left:830px;} .offset7{margin-left:730px;} .offset6{margin-left:630px;} .offset5{margin-left:530px;} .offset4{margin-left:430px;} .offset3{margin-left:330px;} .offset2{margin-left:230px;} .offset1{margin-left:130px;} .row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:"";} .row-fluid:after{clear:both;} .row-fluid [class*="span"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:2.564102564%;*margin-left:2.510911074638298%;} .row-fluid [class*="span"]:first-child{margin-left:0;} .row-fluid .span12{width:100%;*width:99.94680851063829%;} .row-fluid .span11{width:91.45299145300001%;*width:91.3997999636383%;} .row-fluid .span10{width:82.905982906%;*width:82.8527914166383%;} .row-fluid .span9{width:74.358974359%;*width:74.30578286963829%;} .row-fluid .span8{width:65.81196581200001%;*width:65.7587743226383%;} .row-fluid .span7{width:57.264957265%;*width:57.2117657756383%;} .row-fluid .span6{width:48.717948718%;*width:48.6647572286383%;} .row-fluid .span5{width:40.170940171000005%;*width:40.117748681638304%;} .row-fluid .span4{width:31.623931624%;*width:31.5707401346383%;} .row-fluid .span3{width:23.076923077%;*width:23.0237315876383%;} .row-fluid .span2{width:14.529914530000001%;*width:14.4767230406383%;} .row-fluid .span1{width:5.982905983%;*width:5.929714493638298%;} input,textarea,.uneditable-input{margin-left:0;} input.span12, textarea.span12, .uneditable-input.span12{width:1160px;} input.span11, textarea.span11, .uneditable-input.span11{width:1060px;} input.span10, textarea.span10, .uneditable-input.span10{width:960px;} input.span9, textarea.span9, .uneditable-input.span9{width:860px;} input.span8, textarea.span8, .uneditable-input.span8{width:760px;} input.span7, textarea.span7, .uneditable-input.span7{width:660px;} input.span6, textarea.span6, .uneditable-input.span6{width:560px;} input.span5, textarea.span5, .uneditable-input.span5{width:460px;} input.span4, textarea.span4, .uneditable-input.span4{width:360px;} input.span3, textarea.span3, .uneditable-input.span3{width:260px;} input.span2, textarea.span2, .uneditable-input.span2{width:160px;} input.span1, textarea.span1, .uneditable-input.span1{width:60px;} .thumbnails{margin-left:-30px;} .thumbnails>li{margin-left:30px;} .row-fluid .thumbnails{margin-left:0;}}@media (max-width:979px){body{padding-top:0;} .navbar-fixed-top,.navbar-fixed-bottom{position:static;} .navbar-fixed-top{margin-bottom:18px;} .navbar-fixed-bottom{margin-top:18px;} .navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px;} .navbar .container{width:auto;padding:0;} .navbar .brand{padding-left:10px;padding-right:10px;margin:0 0 0 -5px;} .nav-collapse{clear:both;} .nav-collapse .nav{float:none;margin:0 0 9px;} .nav-collapse .nav>li{float:none;} .nav-collapse .nav>li>a{margin-bottom:2px;} .nav-collapse .nav>.divider-vertical{display:none;} .nav-collapse .nav .nav-header{color:#999999;text-shadow:none;} .nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:6px 15px;font-weight:bold;color:#999999;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;} .nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;} .nav-collapse .dropdown-menu li+li a{margin-bottom:2px;} .nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#222222;} .nav-collapse.in .btn-group{margin-top:5px;padding:0;} .nav-collapse .dropdown-menu{position:static;top:auto;left:auto;float:none;display:block;max-width:none;margin:0 15px;padding:0;background-color:transparent;border:none;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;} .nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none;} .nav-collapse .dropdown-menu .divider{display:none;} .nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:9px 15px;margin:9px 0;border-top:1px solid #222222;border-bottom:1px solid #222222;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);} .navbar .nav-collapse .nav.pull-right{float:none;margin-left:0;} .nav-collapse,.nav-collapse.collapse{overflow:hidden;height:0;} .navbar .btn-navbar{display:block;} .navbar-static .navbar-inner{padding-left:10px;padding-right:10px;}}@media (min-width:980px){.nav-collapse.collapse{height:auto !important;overflow:visible !important;}}
=== added directory 'docs/_templates/ubuntu1210/static/lib/font'
=== added file 'docs/_templates/ubuntu1210/static/lib/font/font-awesome.css'
--- docs/_templates/ubuntu1210/static/lib/font/font-awesome.css 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/static/lib/font/font-awesome.css 2013-10-09 20:38:29 +0000
@@ -0,0 +1,309 @@
+/* Font Awesome
+ the iconic font designed for use with Twitter Bootstrap
+ -------------------------------------------------------
+ The full suite of pictographic icons, examples, and documentation
+ can be found at: http://fortawesome.github.com/Font-Awesome/
+
+ License
+ -------------------------------------------------------
+ The Font Awesome webfont, CSS, and LESS files are licensed under CC BY 3.0:
+ http://creativecommons.org/licenses/by/3.0/ A mention of
+ 'Font Awesome - http://fortawesome.github.com/Font-Awesome' in human-readable
+ source code is considered acceptable attribution (most common on the web).
+ If human readable source code is not available to the end user, a mention in
+ an 'About' or 'Credits' screen is considered acceptable (most common in desktop
+ or mobile software).
+
+ Contact
+ -------------------------------------------------------
+ Email: dave@xxxxxxxxxxxxx
+ Twitter: http://twitter.com/fortaweso_me
+ Work: http://lemonwi.se co-founder
+ */
+
+/* sprites.less reset */
+[class^="icon-"], [class*=" icon-"] {
+ display: inline;
+ width: auto;
+ height: auto;
+ line-height: inherit;
+ vertical-align: baseline;
+ background-image: none;
+ background-position: 0% 0%;
+ background-repeat: repeat;
+}
+li[class^="icon-"], li[class*=" icon-"] {
+ display: block;
+}
+/* Font Awesome styles
+ ------------------------------------------------------- */
+[class^="icon-"]:before, [class*=" icon-"]:before {
+ font-family: FontAwesome;
+ font-weight: normal;
+ font-style: normal;
+ display: inline-block;
+ text-decoration: inherit;
+}
+a [class^="icon-"], a [class*=" icon-"] {
+ display: inline-block;
+ text-decoration: inherit;
+}
+/* makes the font 33% larger relative to the icon container */
+.icon-large:before {
+ vertical-align: top;
+ font-size: 1.3333333333333333em;
+}
+.btn [class^="icon-"], .btn [class*=" icon-"] {
+ /* keeps button heights with and without icons the same */
+
+ line-height: .9em;
+}
+li [class^="icon-"], li [class*=" icon-"] {
+ display: inline-block;
+ width: 1.25em;
+ text-align: center;
+}
+li .icon-large[class^="icon-"], li .icon-large[class*=" icon-"] {
+ /* 1.5 increased font size for icon-large * 1.25 width */
+
+ width: 1.875em;
+}
+li[class^="icon-"], li[class*=" icon-"] {
+ margin-left: 0;
+ list-style-type: none;
+}
+li[class^="icon-"]:before, li[class*=" icon-"]:before {
+ text-indent: -2em;
+ text-align: center;
+}
+li[class^="icon-"].icon-large:before, li[class*=" icon-"].icon-large:before {
+ text-indent: -1.3333333333333333em;
+}
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
+ readers do not read off random characters that represent icons */
+.icon-glass:before { content: "\f000"; }
+.icon-music:before { content: "\f001"; }
+.icon-search:before { content: "\f002"; }
+.icon-envelope:before { content: "\f003"; }
+.icon-heart:before { content: "\f004"; }
+.icon-star:before { content: "\f005"; }
+.icon-star-empty:before { content: "\f006"; }
+.icon-user:before { content: "\f007"; }
+.icon-film:before { content: "\f008"; }
+.icon-th-large:before { content: "\f009"; }
+.icon-th:before { content: "\f00a"; }
+.icon-th-list:before { content: "\f00b"; }
+.icon-ok:before { content: "\f00c"; }
+.icon-remove:before { content: "\f00d"; }
+.icon-zoom-in:before { content: "\f00e"; }
+
+.icon-zoom-out:before { content: "\f010"; }
+.icon-off:before { content: "\f011"; }
+.icon-signal:before { content: "\f012"; }
+.icon-cog:before { content: "\f013"; }
+.icon-trash:before { content: "\f014"; }
+.icon-home:before { content: "\f015"; }
+.icon-file:before { content: "\f016"; }
+.icon-time:before { content: "\f017"; }
+.icon-road:before { content: "\f018"; }
+.icon-download-alt:before { content: "\f019"; }
+.icon-download:before { content: "\f01a"; }
+.icon-upload:before { content: "\f01b"; }
+.icon-inbox:before { content: "\f01c"; }
+.icon-play-circle:before { content: "\f01d"; }
+.icon-repeat:before { content: "\f01e"; }
+
+/* \f020 is not a valid unicode character. all shifted one down */
+.icon-refresh:before { content: "\f021"; }
+.icon-list-alt:before { content: "\f022"; }
+.icon-lock:before { content: "\f023"; }
+.icon-flag:before { content: "\f024"; }
+.icon-headphones:before { content: "\f025"; }
+.icon-volume-off:before { content: "\f026"; }
+.icon-volume-down:before { content: "\f027"; }
+.icon-volume-up:before { content: "\f028"; }
+.icon-qrcode:before { content: "\f029"; }
+.icon-barcode:before { content: "\f02a"; }
+.icon-tag:before { content: "\f02b"; }
+.icon-tags:before { content: "\f02c"; }
+.icon-book:before { content: "\f02d"; }
+.icon-bookmark:before { content: "\f02e"; }
+.icon-print:before { content: "\f02f"; }
+
+.icon-camera:before { content: "\f030"; }
+.icon-font:before { content: "\f031"; }
+.icon-bold:before { content: "\f032"; }
+.icon-italic:before { content: "\f033"; }
+.icon-text-height:before { content: "\f034"; }
+.icon-text-width:before { content: "\f035"; }
+.icon-align-left:before { content: "\f036"; }
+.icon-align-center:before { content: "\f037"; }
+.icon-align-right:before { content: "\f038"; }
+.icon-align-justify:before { content: "\f039"; }
+.icon-list:before { content: "\f03a"; }
+.icon-indent-left:before { content: "\f03b"; }
+.icon-indent-right:before { content: "\f03c"; }
+.icon-facetime-video:before { content: "\f03d"; }
+.icon-picture:before { content: "\f03e"; }
+
+.icon-pencil:before { content: "\f040"; }
+.icon-map-marker:before { content: "\f041"; }
+.icon-adjust:before { content: "\f042"; }
+.icon-tint:before { content: "\f043"; }
+.icon-edit:before { content: "\f044"; }
+.icon-share:before { content: "\f045"; }
+.icon-check:before { content: "\f046"; }
+.icon-move:before { content: "\f047"; }
+.icon-step-backward:before { content: "\f048"; }
+.icon-fast-backward:before { content: "\f049"; }
+.icon-backward:before { content: "\f04a"; }
+.icon-play:before { content: "\f04b"; }
+.icon-pause:before { content: "\f04c"; }
+.icon-stop:before { content: "\f04d"; }
+.icon-forward:before { content: "\f04e"; }
+
+.icon-fast-forward:before { content: "\f050"; }
+.icon-step-forward:before { content: "\f051"; }
+.icon-eject:before { content: "\f052"; }
+.icon-chevron-left:before { content: "\f053"; }
+.icon-chevron-right:before { content: "\f054"; }
+.icon-plus-sign:before { content: "\f055"; }
+.icon-minus-sign:before { content: "\f056"; }
+.icon-remove-sign:before { content: "\f057"; }
+.icon-ok-sign:before { content: "\f058"; }
+.icon-question-sign:before { content: "\f059"; }
+.icon-info-sign:before { content: "\f05a"; }
+.icon-screenshot:before { content: "\f05b"; }
+.icon-remove-circle:before { content: "\f05c"; }
+.icon-ok-circle:before { content: "\f05d"; }
+.icon-ban-circle:before { content: "\f05e"; }
+
+.icon-arrow-left:before { content: "\f060"; }
+.icon-arrow-right:before { content: "\f061"; }
+.icon-arrow-up:before { content: "\f062"; }
+.icon-arrow-down:before { content: "\f063"; }
+.icon-share-alt:before { content: "\f064"; }
+.icon-resize-full:before { content: "\f065"; }
+.icon-resize-small:before { content: "\f066"; }
+.icon-plus:before { content: "\f067"; }
+.icon-minus:before { content: "\f068"; }
+.icon-asterisk:before { content: "\f069"; }
+.icon-exclamation-sign:before { content: "\f06a"; }
+.icon-gift:before { content: "\f06b"; }
+.icon-leaf:before { content: "\f06c"; }
+.icon-fire:before { content: "\f06d"; }
+.icon-eye-open:before { content: "\f06e"; }
+
+.icon-eye-close:before { content: "\f070"; }
+.icon-warning-sign:before { content: "\f071"; }
+.icon-plane:before { content: "\f072"; }
+.icon-calendar:before { content: "\f073"; }
+.icon-random:before { content: "\f074"; }
+.icon-comment:before { content: "\f075"; }
+.icon-magnet:before { content: "\f076"; }
+.icon-chevron-up:before { content: "\f077"; }
+.icon-chevron-down:before { content: "\f078"; }
+.icon-retweet:before { content: "\f079"; }
+.icon-shopping-cart:before { content: "\f07a"; }
+.icon-folder-close:before { content: "\f07b"; }
+.icon-folder-open:before { content: "\f07c"; }
+.icon-resize-vertical:before { content: "\f07d"; }
+.icon-resize-horizontal:before { content: "\f07e"; }
+
+.icon-bar-chart:before { content: "\f080"; }
+.icon-twitter-sign:before { content: "\f081"; }
+.icon-facebook-sign:before { content: "\f082"; }
+.icon-camera-retro:before { content: "\f083"; }
+.icon-key:before { content: "\f084"; }
+.icon-cogs:before { content: "\f085"; }
+.icon-comments:before { content: "\f086"; }
+.icon-thumbs-up:before { content: "\f087"; }
+.icon-thumbs-down:before { content: "\f088"; }
+.icon-star-half:before { content: "\f089"; }
+.icon-heart-empty:before { content: "\f08a"; }
+.icon-signout:before { content: "\f08b"; }
+.icon-linkedin-sign:before { content: "\f08c"; }
+.icon-pushpin:before { content: "\f08d"; }
+.icon-external-link:before { content: "\f08e"; }
+
+.icon-signin:before { content: "\f090"; }
+.icon-trophy:before { content: "\f091"; }
+.icon-github-sign:before { content: "\f092"; }
+.icon-upload-alt:before { content: "\f093"; }
+.icon-lemon:before { content: "\f094"; }
+.icon-phone:before { content: "\f095"; }
+.icon-check-empty:before { content: "\f096"; }
+.icon-bookmark-empty:before { content: "\f097"; }
+.icon-phone-sign:before { content: "\f098"; }
+.icon-twitter:before { content: "\f099"; }
+.icon-facebook:before { content: "\f09a"; }
+.icon-github:before { content: "\f09b"; }
+.icon-unlock:before { content: "\f09c"; }
+.icon-credit-card:before { content: "\f09d"; }
+.icon-rss:before { content: "\f09e"; }
+
+.icon-hdd:before { content: "\f0a0"; }
+.icon-bullhorn:before { content: "\f0a1"; }
+.icon-bell:before { content: "\f0a2"; }
+.icon-certificate:before { content: "\f0a3"; }
+.icon-hand-right:before { content: "\f0a4"; }
+.icon-hand-left:before { content: "\f0a5"; }
+.icon-hand-up:before { content: "\f0a6"; }
+.icon-hand-down:before { content: "\f0a7"; }
+.icon-circle-arrow-left:before { content: "\f0a8"; }
+.icon-circle-arrow-right:before { content: "\f0a9"; }
+.icon-circle-arrow-up:before { content: "\f0aa"; }
+.icon-circle-arrow-down:before { content: "\f0ab"; }
+.icon-globe:before { content: "\f0ac"; }
+.icon-wrench:before { content: "\f0ad"; }
+.icon-tasks:before { content: "\f0ae"; }
+
+.icon-filter:before { content: "\f0b0"; }
+.icon-briefcase:before { content: "\f0b1"; }
+.icon-fullscreen:before { content: "\f0b2"; }
+
+.icon-group:before { content: "\f0c0"; }
+.icon-link:before { content: "\f0c1"; }
+.icon-cloud:before { content: "\f0c2"; }
+.icon-beaker:before { content: "\f0c3"; }
+.icon-cut:before { content: "\f0c4"; }
+.icon-copy:before { content: "\f0c5"; }
+.icon-paper-clip:before { content: "\f0c6"; }
+.icon-save:before { content: "\f0c7"; }
+.icon-sign-blank:before { content: "\f0c8"; }
+.icon-reorder:before { content: "\f0c9"; }
+.icon-list-ul:before { content: "\f0ca"; }
+.icon-list-ol:before { content: "\f0cb"; }
+.icon-strikethrough:before { content: "\f0cc"; }
+.icon-underline:before { content: "\f0cd"; }
+.icon-table:before { content: "\f0ce"; }
+
+.icon-magic:before { content: "\f0d0"; }
+.icon-truck:before { content: "\f0d1"; }
+.icon-pinterest:before { content: "\f0d2"; }
+.icon-pinterest-sign:before { content: "\f0d3"; }
+.icon-google-plus-sign:before { content: "\f0d4"; }
+.icon-google-plus:before { content: "\f0d5"; }
+.icon-money:before { content: "\f0d6"; }
+.icon-caret-down:before { content: "\f0d7"; }
+.icon-caret-up:before { content: "\f0d8"; }
+.icon-caret-left:before { content: "\f0d9"; }
+.icon-caret-right:before { content: "\f0da"; }
+.icon-columns:before { content: "\f0db"; }
+.icon-sort:before { content: "\f0dc"; }
+.icon-sort-down:before { content: "\f0dd"; }
+.icon-sort-up:before { content: "\f0de"; }
+
+.icon-envelope-alt:before { content: "\f0e0"; }
+.icon-linkedin:before { content: "\f0e1"; }
+.icon-undo:before { content: "\f0e2"; }
+.icon-legal:before { content: "\f0e3"; }
+.icon-dashboard:before { content: "\f0e4"; }
+.icon-comment-alt:before { content: "\f0e5"; }
+.icon-comments-alt:before { content: "\f0e6"; }
+.icon-bolt:before { content: "\f0e7"; }
+.icon-sitemap:before { content: "\f0e8"; }
+.icon-umbrella:before { content: "\f0e9"; }
+.icon-paste:before { content: "\f0ea"; }
+
+.icon-user-md:before { content: "\f200"; }
=== added file 'docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.eot'
Binary files docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.eot 1970-01-01 00:00:00 +0000 and docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.eot 2013-10-09 20:38:29 +0000 differ
=== added file 'docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.svg'
--- docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.svg 1970-01-01 00:00:00 +0000
+++ docs/_templates/ubuntu1210/static/lib/font/fontawesome-webfont.svg 2013-10-09 20:38:29 +0000
@@ -0,0 +1,255 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
+<svg xmlns="http://www.w3.org/2000/svg">
+<metadata></metadata>
+<defs>
+<font id="FontAwesomeRegular" horiz-adv-x="1843" >
+<font-face units-per-em="2048" ascent="1536" descent="-512" />
+<missing-glyph horiz-adv-x="512" />
+<glyph horiz-adv-x="0" />
+<glyph horiz-adv-x="0" />
+<glyph unicode="
" horiz-adv-x="512" />
+<glyph unicode=" " horiz-adv-x="512" />
+<glyph unicode="	" horiz-adv-x="512" />
+<glyph unicode=" " horiz-adv-x="512" />
+<glyph unicode="o" horiz-adv-x="1591" />
+<glyph unicode="¨" horiz-adv-x="2048" />
+<glyph unicode="©" horiz-adv-x="2048" />
+<glyph unicode="®" horiz-adv-x="2048" />
+<glyph unicode="´" horiz-adv-x="2048" />
+<glyph unicode="Æ" horiz-adv-x="2048" />
+<glyph unicode="Í" horiz-adv-x="2048" />
+<glyph unicode=" " horiz-adv-x="784" />
+<glyph unicode=" " horiz-adv-x="1569" />
+<glyph unicode=" " horiz-adv-x="784" />
+<glyph unicode=" " horiz-adv-x="1569" />
+<glyph unicode=" " horiz-adv-x="523" />
+<glyph unicode=" " horiz-adv-x="392" />
+<glyph unicode=" " horiz-adv-x="261" />
+<glyph unicode=" " horiz-adv-x="261" />
+<glyph unicode=" " horiz-adv-x="196" />
+<glyph unicode=" " horiz-adv-x="313" />
+<glyph unicode=" " horiz-adv-x="87" />
+<glyph unicode=" " horiz-adv-x="313" />
+<glyph unicode="›" horiz-adv-x="2048" />
+<glyph unicode=" " horiz-adv-x="392" />
+<glyph unicode="™" horiz-adv-x="2048" />
+<glyph unicode="∞" horiz-adv-x="2048" />
+<glyph unicode="" horiz-adv-x="1024" d="M0 0z" />
+<glyph unicode="" horiz-adv-x="1536" d="M6 1489q20 47 70 47h1382q51 0 72 -47q20 -47 -17 -84l-610 -610v-641h248q33 0 55.5 -22.5t22.5 -53.5q0 -33 -22.5 -55.5t-55.5 -22.5h-768q-31 0 -53.5 22.5t-22.5 55.5q0 31 22.5 53.5t53.5 22.5h250v641l-610 610q-37 37 -17 84z" />
+<glyph unicode="" horiz-adv-x="1488" d="M0 213q0 57 27.5 103t72.5 77t98.5 47.5t106.5 16.5q25 0 50.5 -4t50.5 -11v779q0 27 16 48t43 29q23 6 99.5 29t178 52.5t215 62.5t211 60.5t164 46t74.5 18.5q35 0 58.5 -23.5t23.5 -58.5v-1028q0 -59 -27.5 -104.5t-73 -76t-99.5 -47t-105 -16.5t-105.5 16.5t-98.5 47 t-71.5 75.5t-27.5 105q0 57 27.5 103t71.5 77t98.5 47t105.5 16q27 0 52.5 -4t49.5 -10v537l-678 -195v-815q0 -59 -27.5 -104.5t-71.5 -76t-98.5 -47t-105.5 -16.5q-53 0 -106.5 16.5t-98.5 47t-72.5 76t-27.5 104.5z" />
+<glyph unicode="" horiz-adv-x="1597" d="M0 901q0 137 52 258t143.5 212t212 143.5t258.5 52.5q137 0 257.5 -52.5t212 -143.5t14
References