Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

#!/usr/local/bin/python 

# encoding: utf-8 

""" 

constants 

=============== 

:Summary: 

    Some commonly used constants 

 

:Author: 

    David Young 

 

:Date Created: 

    March 22, 2013 

 

:dryx syntax: 

    - ``xxx`` = come back here and do some more work 

    - ``_someObject`` = a 'private' object that should only be changed for debugging 

 

:Notes: 

    - If you have any questions requiring this script please email me: d.r.young@qub.ac.uk 

""" 

################# GLOBAL IMPORTS #################### 

import sys 

import os 

 

###################################################### 

# MAIN LOOP - USED FOR DEBUGGING OR WHEN SCRIPTING   # 

###################################################### 

def main(): 

    """one-line summary 

 

    Key Arguments: 

        - 

        - dbConn -- mysql database connection 

        - log -- logger 

 

    Return: 

        - None 

    """ 

    ################ > IMPORTS ################ 

    ## STANDARD LIB ## 

    ## THIRD PARTY ## 

    ## LOCAL APPLICATION ## 

    import pesstoMarshallPythonPath as pp 

    pp.set_python_path() 

    import pmCommonUtils as p 

    import dryxPython.commonutils as cu 

 

    ################ > SETUP ################## 

    ## SETUP DB CONNECTION AND A LOGGER 

    dbConn, log = p.settings() 

    ## START LOGGING ## 

    startTime = cu.get_now_sql_datetime() 

    log.info('--- STARTING TO RUN THE constants AT %s' % (startTime,)) 

 

    ################ > VARIABLE SETTINGS ###### 

    ################ >ACTION(S) ############### 

 

    dbConn.commit () 

    dbConn.close () 

    ## FINISH LOGGING ## 

    endTime = cu.get_now_sql_datetime() 

    runningTime = cu.calculate_time_difference(startTime,endTime) 

    log.info('-- FINISHED ATTEMPT TO RUN THE constants AT %s (RUNTIME: %s) --' % (endTime,runningTime,)) 

    return 

 

################################################################### 

# CLASSES                                                         # 

################################################################### 

 

################################################################### 

# PUBLIC FUNCTIONS                                                # 

################################################################### 

 

################################################################### 

# PRIVATE (HELPER) FUNCTIONS                                      # 

################################################################### 

 

if __name__ == '__main__': 

    main() 

 

 

################################################################### 

# TEMPLATE FUNCTIONS                                              # 

###################################################################