2016-02-24 08:33:49 +00:00
|
|
|
import os
|
2016-02-26 14:32:36 +00:00
|
|
|
import time
|
2016-02-19 21:10:24 +00:00
|
|
|
|
2016-02-21 20:25:37 +00:00
|
|
|
program_version = '0.0.1 (alpha)'
|
|
|
|
|
|
|
|
|
2016-02-19 21:10:24 +00:00
|
|
|
def log(data):
|
2016-02-21 20:25:37 +00:00
|
|
|
with open('logs.log', 'a') as fl:
|
2016-02-19 21:10:24 +00:00
|
|
|
fl.write(str(data))
|
|
|
|
|
2016-02-20 08:06:24 +00:00
|
|
|
|
2016-02-24 08:33:49 +00:00
|
|
|
def curr_directory():
|
|
|
|
return os.path.dirname(os.path.realpath(__file__))
|
2016-02-24 15:32:35 +00:00
|
|
|
|
|
|
|
|
2016-02-26 14:32:36 +00:00
|
|
|
def curr_time():
|
2016-02-27 17:03:33 +00:00
|
|
|
return time.strftime("%H:%M")
|
2016-02-26 14:32:36 +00:00
|
|
|
|
|
|
|
|
2016-02-24 15:32:35 +00:00
|
|
|
class Singleton(object):
|
|
|
|
|
2016-02-25 20:40:00 +00:00
|
|
|
def __new__(cls, *args):
|
2016-02-24 15:32:35 +00:00
|
|
|
if not hasattr(cls, 'instance'):
|
2016-02-25 20:40:00 +00:00
|
|
|
cls.instance = super(Singleton, cls,).__new__(cls, *args)
|
2016-02-24 15:32:35 +00:00
|
|
|
return cls.instance
|