====== HUW code ====== ===== Modules ===== ==== Init ==== - init variables - init classes - calls all inits direct available - init or open db ==== read parameter ==== - need file and db - check availability of parameter file - read file into classes - log all read values into db ==== notification ==== - send email - log into db - if error in send or db write, try to log to file ==== logging ==== - write to db - in case of error use Notification ==== check ==== ==== measure ==== ===== Environments ===== ==== Code lib ==== ==== Dev ==== ==== Prod ==== ===== principles ===== ==== Error management ==== - check # of parameter of calls - check length, range, values of calls - use try ... except - 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==== - corr: correction - idx: index - hum: humidity - no: number - temp: temperature - txt: text ==== Variables ==== === Principles === - avoid "global" variables === Used Variables === - cnt: counter - data: bin data - db: database handle - e: error - f: file handle - i: counter - l: line - r: range - row: db row - s: sensor - t: text string - ta: time ASCII - ti: time integer ==== OS ==== - only linux ==== Python ==== - 2.7