Benutzer-Werkzeuge

Webseiten-Werkzeuge


python_huw_code

HUW code

Modules

Init

  1. init variables
  2. init classes
  3. calls all inits direct available
  4. init or open db

read parameter

  1. need file and db
  2. check availability of parameter file
  3. read file into classes
  4. log all read values into db

notification

  1. send email
  2. log into db
  3. if error in send or db write, try to log to file

logging

  1. write to db
  2. in case of error use Notification

check

measure

Environments

Code lib

Dev

Prod

principles

Error management

  1. check # of parameter of calls
  2. check length, range, values of calls
  3. use
     try ... except 
  4. use one global Exit procedure

module test

literals

naming

  • LITERALS in capital letter
  • variables in small letter, if one word only
  • combinedVariables first word small, all later starting with a Capital letter
  • Procedures strting with a capital letter

used abbreviations

  1. corr: correction
  2. idx: index
  3. hum: humidity
  4. no: number
  5. temp: temperature
  6. txt: text

Variables

Principles

  1. avoid „global“ variables

Used Variables

  1. cnt: counter
  2. data: bin data
  3. db: database handle
  4. e: error
  5. f: file handle
  6. i: counter
  7. l: line
  8. r: range
  9. row: db row
  10. s: sensor
  11. t: text string
  12. ta: time ASCII
  13. ti: time integer

OS

  1. only linux

Python

  1. 2.7
python_huw_code.txt · Zuletzt geändert: von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki