pywws.service.copy

Copy files to another directory.

This module can be used to copy template and graph results to another directory on your computer. This could be useful if you are running a web server on the same machine as pywws (or on a machine that’s accessible as a network share).

  • Example weather.ini configuration:

    [copy]
    directory = /home/www/public_html/weather/data/
    
    [hourly]
    plot = ['24hrs.png.xml', 'rose_12hrs.png.xml']
    text = ['24hrs.txt']
    services = [('copy', '24hrs.txt', '24hrs.png', 'rose_12hrs.png')]
    

Run pywws.service.copy once to set the default configuration, which you can then change. directory is the full path of a directory in which all the copied files will be put.

You can copy any files you like, as often as you like, but typical usage is to update a website once an hour. Each file to be uploaded needs to be listed in a service entry like ('copy', 'filename'). If the file is not in your work directory’s output directory then filename should be the full path.

If you need to copy some files to a different directory you can copy the pywws.service.copy module to your modules directory, making sure that you rename it, for example to copy2.py. This creates a copy2 service that you can use in the same way, but with a different directory.

Classes

ToService(context[, check_params])


Comments or questions? Please subscribe to the pywws mailing list http://groups.google.com/group/pywws and let us know.