wiki:Version_2_tools
close Warning: Can't synchronize with repository "(default)" (/ekpwww/subversion/HappyFace does not appear to be a Subversion repository.). Look in the Trac log for more information.

List of Helper Tools

Currently the following helper tools can be found in the ./tools directory within the checked out HappyFace repository.

Tools: Module Skeleton Creation Script

Name: hf-dump-skeleton.py

Description:
This script creates skeleton files for a new HappyFace module. For that purpose, .cfg and .py files are created in the proper locations: happycore and modules.

Usage:

usage: hf-dump-skeleton [option]
be careful! No testing of this script yet!
options are

-h,--help:                      print this message and exit
-x,--xml:                       if switched on, the skeleton for xml parsing will be added.
                                default is False.
-n ARG, --name=ARG:             define the name of the new test.

Tools: DB Cleanup Script

Name: hf-cleanup.py

Description:
This script cleans up the HappyFace database by removing data from it that is no longer needed:

Usage:

hf-cleanup [options] <Happyface Database File>

This script performs three steps to clean up the HappyFace database:
1) It removes old entries of existing modules
2) It removes any remaining data belonging to modules no longer in use
3) It optimizes the database file

Possible options are:

--start=TIMESTAMP	if given only erase database entries recorded after TIMESTAMP
--end=TIMESTAMP		if given only erase database entries recorded before TIMESTAMP
--modules=MODULES	specifies a comma-separated list of modules to clean up

All three options only affect the first of the three steps explained above.
If TIMESTAMP for --start or --end is lower then it is interpreted as the
number of days since the time of executing the script. If either --start or
--end are not given then they are taken as 0 or the current time, respectively.
If --modules is not given then all modules are cleaned up. However, for each
module and for each of the three steps there will be a confirmation prompt to
explicitely confirm deletion of data.

WARNING: This means that if you run hf-cleanup without --start and without
--end then it will erase the entire database for selected modules (if
confirmed at the prompt).

Examples:

./hf-cleanup HappyFace.db
Erases the complete HappyFace database.

./hf-cleanup --modules=qstat HappyFace.db
Erases all entries for the qstat module from the HappyFace database.

./hf-cleanup --end=100 HappyFace.db
Removes all entries from the HappyFace database that are older than 100 days.

./hf-cleanup --end=1279626292 HappyFace.db
Removes all entries from the HappyFace database from before
Tue Jul 20 13:45 CEST 2010.

./hf-cleanup --modules=none HappyFace.db
Skips the first of the three steps (this could also be achieved by answering q
at the first prompt).

Tools: DB Merge Script

Name: hf-merge.py

Description:
This script merges one HappyFace instance into another.

Usage:

hf-merge [options] --into=<Destination Database File> <Source HappyFace Database File>

This tool merges one HappyFace instance into another. This can be useful if
you shut your main instance down for maintenance and run a secondary instance
during that time. Using this script you can merge the data of the secondary
instance into the main instance so that you can remove the secondary instance
afterwards without losing data.

The following options are possible:

--into=FILE		Database file of the HappyFace instance to merge into
--start=TIMESTAMP	if given only merge database entries recorded after TIMESTAMP
--end=TIMESTAMP		if given only merge database entries recorded before TIMESTAMP

If --start and/or --end are given then only database entries in the specified
timerange are merged. If you want to merge the complete database then you do
not need to specify them. Entries which are already contained in the
destination database already will not be overwritten. Note that the --into
option is required.

Tools: DB Migration Script

Name: hf-migrate.py

Description:
The directory layout of the HappyFace archive changed in revision 381. If you ran HappyFace before that and if you either want the history functionality to be able to access entries from before you upgraded or to run one of the other scripts on the data from before the upgrade then you should migrate the Database file using this script.

Usage:

hf-migrate [options] <HappyFace Database File>

This tool migrates a HappyFace archive into new format. The new format is used
since revision 381. If the database is not migrated then history
functionality for entries generated by previous versions might be limited.

The following options are possible:

--start=TIMESTAMP	if given only migrate database entries recorded after TIMESTAMP
--end=TIMESTAMP		if given only migrate database entries recorded before TIMESTAMP
-f			Wipe database entries for which no archive file exists

If --start and/or --end are given then only database entries in the specified
timerange are migrated. They are not normally needed since the script does not
do anything for entries which are already according to the new format but
providing them might speed it up a bit.
Last modified 7 years ago Last modified on 2010-07-20T14:25:35+02:00