Ejemplo n.º 1
0
def deviceInfoExists(family, type_, version):
    return os.access(absConfigurationFilename(getDeviceFileName(family, type_, version)), os.F_OK)
Ejemplo n.º 2
0
## with this program; if not, write to the Free Software Foundation, Inc.,
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
##
##

try:
    import ConfigParser as configparser
except ImportError:
    import configparser # Python 3.x

import logging
import os
import threading
from genicontrol.utils import absConfigurationFilename

CFG_FILE_NAME = absConfigurationFilename('.GeniControl.cfg')
print "CONFIGURATION FILE: %s" % CFG_FILE_NAME

class Config(object):
    _lock = threading.Lock()
    logger = logging.getLogger("genicontrol")

    def __new__(cls):
        try:
            cls._lock.acquire()
            if not hasattr(cls, '_instance'):
                cls._instance = super(cls.__class__, cls).__new__(cls)
        finally:
            cls._lock.release()
        return cls._instance