Web validation

J. Clifford Dyer jcd at sdf.lonestar.org
Tue Apr 7 07:53:33 EDT 2009


On Tue, 2009-04-07 at 08:44 +1000, r-w wrote:
> If no internet connection:
>      if have files:
>          run anyway, with warning
>      else:
>          ERROR
> else:
>      if error getting hash/files:
>          if have files:
>              run anyway, with warning
>          else:
>              ERROR
>      else:
>          run
> --
> http://mail.python.org/mailman/listinfo/python-list
> 

import logging

def run_with_files(files):
    if files:
        logging.warn("warning")
        run()
    else:
        logging.error("error")
        raise IOError

if internet_connection() and got_hash():
    run()
else:
    run_with_files(files)





More information about the Python-list mailing list