Module Tools
[hide private]
[frames] | no frames]

Source Code for Module Tools

 1  # Tools.py 
 2   
 3  ''' 
 4  Helper class with some useful static methods. 
 5   
 6   This software is part of the raspibrick module. 
 7   It is Open Source Free Software, so you may 
 8   - run the code for any purpose 
 9   - study how the code works and adapt it to your needs 
10   - integrate all or parts of the code in your own programs 
11   - redistribute copies of the code 
12   - improve the code and release your improvements to the public 
13   However the use of the code is entirely your responsibility. 
14   ''' 
15   
16  import time 
17  import SharedConstants 
18 19 -class Tools():
20 ''' 21 Helper class with some useful static methods. 22 ''' 23 @staticmethod
24 - def debug(text):
25 if SharedConstants.DEBUG: 26 print "Tools debug->", text
27 28 @staticmethod
29 - def delay(interval):
30 """ 31 Suspends execution for a given time inverval. 32 @param interval: the time interval in milliseconds (ms) 33 @return: none 34 """ 35 time.sleep(interval / 1000.0)
36