# Copyright (C) 2010 W. Trevor King # # This file is part of Hooke. # # Hooke is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # Hooke 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 Lesser General # Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with Hooke. If not, see # . """ Test the commands listed in :file:`doc/tutorial.txt`. >>> import os >>> import os.path >>> from hooke.hooke import Hooke, HookeRunner >>> h = Hooke() >>> r = HookeRunner() *Help* >>> h = r.run_lines(h, ['help']) # doctest: +ELLIPSIS Documented commands (type help ): ======================================== ... >>> h = r.run_lines(h, ['help load_playlist']) Command: load_playlist Arguments: help BOOL (bool) Print a help message. output_playlist STRING (string) Name of the new playlist (defaults to an auto-generated name). input FILE (file) File name for the input playlist. drivers DRIVER (driver) Drivers for loading curves. Load a playlist. ---- Usage: load_playlist [options] input *Creating a playlist* >>> h = r.run_lines(h, ['cd --path .']) Success >>> h = r.run_lines(h, ['pwd']) # doctest: +ELLIPSIS /.../hooke Success >>> h = r.run_lines(h, ['ls']) # doctest: +ELLIPSIS +REPORT_UDIFF .hg ... AUTHORS ... README ... hooke ... Success >>> h = r.run_lines(h, ['new_playlist --output_playlist mylist']) Success >>> h = r.run_lines(h, ['jump_to_playlist -- -1']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['glob_curves_to_playlist test/data/vclamp_picoforce/*'] ... ) # doctest: +ELLIPSIS ... Success >>> playlist_already_exists = os.path.exists('mylist.hkp') >>> playlist_already_exists False >>> h = r.run_lines(h, ['save_playlist --output mylist']) Success >>> os.path.isfile('mylist.hkp') True >>> h = r.run_lines(h, ['load_playlist mylist.hkp']) Success >>> if playlist_already_exists == False: ... os.remove('mylist.hkp') *Navigating the playlist* >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['next_curve']) Success >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['previous_curve']) Success >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['curve_index']) 0 Success >>> h = r.run_lines(h, ['previous_curve']) Success >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['curve_index']) 101 Success >>> h = r.run_lines(h, ['next_curve']) Success >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['curve_index']) 0 Success >>> h = r.run_lines(h, ['jump_to_curve 14']) Success >>> h = r.run_lines(h, ['get_curve']) Success >>> h = r.run_lines(h, ['curve_index']) 14 Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['next_playlist']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['previous_playlist']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['playlist_index']) 0 Success >>> h = r.run_lines(h, ['previous_playlist']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['playlist_index']) 1 Success >>> h = r.run_lines(h, ['next_playlist']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['playlist_index']) 0 Success >>> h = r.run_lines(h, ['jump_to_playlist 1']) Success >>> h = r.run_lines(h, ['get_playlist']) Success >>> h = r.run_lines(h, ['playlist_index']) 1 Success *Taking notes* See :file:`note.py`. *Exporting curves* See :file:`export_block.py`. *Measuring distances and forces* See :file:`delta.py`. *Worm like chain and freely jointed chain fitting* *Multiple curve fitting and measuring* *Fast curve reviewing and saving* *Configuring Hooke* See :file:`config.py`. """