aww news
Description
Download
WML

SourceForge.net Logo




NAME

Aww::lib - Perl module for aww

EXPORT_OK

admininput checkoptions checksite checktime config execoptions get_filenames get_fullfilenames getsubdirs match optioninput print_error process trashfiles wmlprocess writemainconfig

DESCRIPTION

This is the function library for the aww program. That's why it exports (if you want it) a lot of functions. This library comes in handy if you want to program your own modules for aww. You will find here a short description for every supplied function. How you call it (IN) and what you will get back (OUT).

admininput

This subroutine adds key-valuepairs to the project configfile:

IN : <the new key>

The subroutine then asks for the value of the new key, chomps of the linebreak, applies some sanity checks and hands it over to the config subroutine.

OUT: New element in project configfile

checkoptions

This subroutine checks if the options that are given are OK (if they are in 'PossibleOptions' from the config file)

IN : [all options for the directory]

checksite

This subroutine checks if the projects exist that were given on the commandline.

IN : All projects given on the commandline, or 'all'
OUT: Only the existing projects (of the given), or 'all' projects

checktime

This subroutine checks if destination files to the given source files exist and if they are newer (if they are up to date).

The subroutine checks in the destination directory for the same filename and for a filename with Outputfile_type suffix

If the --force flag is used, the checktime subroutine returns all files that have destination files older than the start of the program.

IN : Sourcefiles to test
OUT: Sourcefiles that don't have a newer Destination-file -> which have to be processed

config

This subroutine is used for all configurations in aww. (replacing all old configuration subroutines)

IN : <config-file>, [parameter to return the value], [input value to write to parameter]
OUT: depends on the input
1. true or false if given config file is readable
2. the value of the parameter that was asked for
3. true (the written value) or false if the new value was successfully written to the config file

connect

The connect subroutine processes the given files of the process directorywith WML-Options to connect to Previous, Up, Next pages etc.

The WML-Options can be accessed in the wml files with <get-var VARIABLENAME>: PREVIOUSFILE, NEXTFILE and UPFILE

In : <Process Directory>,<UpOption - none|alpha|one|a number>,<UpFile Basename>,<@FilesToConnect>
* none: don't use an UpOption
* one: put all Files on one indexpage (for a small number of files)
* alpha|reverse: For alphabetical index pages (a: abla, ablubb and b: bla, blubb and c: cfile, canoterfile) and z to a for reverse, of course
* a number: number or entries per index page
Out: executing the process-function with the right WML-Options(e.g. -DPREVIOUSFILE -DNEXTFILE -DUPFILE)

createthumb

This subroutine creates a thumbnail with the given options.

IN : <SourceDir>, <thumbtype>, <thumbdir>, <maxwidth in px>, <maxheight in px>, <@SrcImges>
OUT: created thumbs , @Thumbpaths

execoptions

This subroutine executes the functions for all options (one after another).

IN : <directory>, [all options of the directory]
OUT: the option-module-function is called with the directory name as argument

get_filenames

This subroutine returns all filenames of given directory that have a special ending.

IN : <directory>, <sort options>, [RegExp]
OUT: Sorted list of filenames that matched the RegExp (ignoring the case)

get_fullfilenames

This subroutine gets all filenames of given directory that match the given RegExp and sorts them after the sortoption. The subroutines calls get_filenames and adds the full path to the files!

IN : <directory>, <sort option>, [RegExpe]
OUT: Sorted list of full filenames with the FileType ending

getsubdirs

This subroutine gets recursivly all subdirectories of given directories

IN : <directories>
OUT: All Subdirectories of the given directories including themselves

image_properties

This subroutine returns the following properties of the input image: width, height, size

IN : <imagefile>
OUT: Hashreference to width, height and size of the image

match

This subroutine checks for every element of a given array if it matches (or not matches) a given RegExp.

IN : <(!)RegExp to match>, <Array to match>
If the first letter of the RegExp is a '!' the match subroutine returns all entries that do NOT match
OUT: Array of all matched elements

optioninput

This subroutine adds new key=value pairs to the project configfile

IN : <directory>

The subroutine then asks for the options of the directory, chomps of the linebreak, applies some sanity checks and hands it to the config subroutine

OUT: New elements in the project configfile [Options]

print_error

This subroutine prints the error-message (IN) and a short help for aww

IN : [Error message]
If no error message is given, this function only prints a short help
OUT: *** ERROR message and a short help -> exit 1 as well

process

This is the core processing subroutine, that directly executes wml

IN : <FullSourceFile>, <FullDestFile>, [wml-options]
OUT: wml -o $FullDestFile @WMLOpts $FullSrcFile

trashfiles

This subroutine collects files that should be deleted befor the program terminates.

IN : < file to delete | _CLEAR >
OUT: deleting files when a _CLEAR is send (e.g. before the end of the program

wmlprocess

This is the main processing subroutine. It checks for newer sourcefiles in the given sourcedirectory and processes all needed files.

IN : <directory>

writemainconfig

This subroutine writes the main configfile to the $HOME/.aww/ directory

AUTHOR

Michael Panhorst <Michael@Panhorst.com>

SEE ALSO

aww, Aww::Main and Aww::Options

BUGS

THIS IS A VERY EARLY ALPHA VERSION!!!

42nd.design || webmaster