move includes in root directory
This commit is contained in:
16
misc.py
Normal file
16
misc.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import time, random, sys, os, string
|
||||
import rocksock
|
||||
|
||||
""" return formatted timestamp """
|
||||
def timestamp():
|
||||
return time.strftime('%H:%M:%S', time.gmtime())
|
||||
|
||||
""" return some random string """
|
||||
def random_string(strlen=20):
|
||||
return ''.join([random.choice(string.letters) for x in xrange(strlen)])
|
||||
|
||||
def _log(strng, level='info'):
|
||||
print '%s/%s\t%s' % (timestamp(), level, strng)
|
||||
|
||||
Reference in New Issue
Block a user