Ejemplo n.º 1
0
    def __init__(self, filename=None, stream=None):

        # init variables
        self.header = None
        self.color_mode = None
        self.image_resources = None

        self.size = None
        self._cur_line = 0
        self.stream = stream
        self.filename = filename

        self.logger = logger.init_logging(self)
        self.logger.info(
            'Initialized <{0}.{1} v{2} object at {3:#018x}>'.format(
                __name__, self.__class__.__name__, g_yaml_cache.get('version'),
                id(self)))

        if not self.stream:
            s = open(self.filename, 'rb')
            self.stream = StringIO.StringIO(s.read())

        self.stream.seek(0, 2)  # go to end of file to get size
        self.size = self.stream.tell()  # inform of current location
        self.stream.seek(0)  # return to beginning of file
        self._cur_line = 0  # default to start of file
Ejemplo n.º 2
0
    def __init__(self, filename=None, stream=None):

        # init variables
        self.header = None
        self.color_mode = None
        self.image_resources = None

        self.size = None
        self._cur_line = 0
        self.stream = stream
        self.filename = filename

        self.logger = logger.init_logging(self)
        self.logger.info('Initialized <{0}.{1} v{2} object at {3:#018x}>'.format(__name__,
                                                                                 self.__class__.__name__,
                                                                                 g_yaml_cache.get('version'),
                                                                                 id(self)))

        if not self.stream:
            s = open(self.filename, 'rb')
            self.stream = StringIO.StringIO(s.read())

        self.stream.seek(0, 2)  # go to end of file to get size
        self.size = self.stream.tell()  # inform of current location
        self.stream.seek(0)  # return to beginning of file
        self._cur_line = 0  # default to start of file
Ejemplo n.º 3
0
 def __init__(self, total):
     self._task_start_time = 0
     self._num_of_completed_tasks = 0
     self._scaling = 0  # (total_steps - elapsed_steps) / elapsed_steps
     self._elapsed_time = 0
     self._stored_times = list()
     self._total_tasks = total
     self.logger = logger.init_logging(self)
Ejemplo n.º 4
0
    def __init__(self):
        super(WorkerThread, self).__init__()
        self._stop = False
        self._queue = list()
        self._queue_mutex = QMutex()
        self._wait_condition = QWaitCondition()
        self._logger = logger.init_logging(self, unique=True)

        self._logger.info('Initializing {0} {1}'.format(self, g_yaml_cache.get('version')))
Ejemplo n.º 5
0
    def __init__(self):
        super(WorkerThread, self).__init__()
        self._stop = False
        self._queue = list()
        self._queue_mutex = QMutex()
        self._wait_condition = QWaitCondition()
        self._logger = logger.init_logging(self, unique=True)

        self._logger.info('Initializing {0} {1}'.format(
            self, g_yaml_cache.get('version')))
Ejemplo n.º 6
0
    def __init__(self):
        self.host = constants.EMAIL[sys.platform]

        # init variables
        self._sender = None
        self._recipients = Receiver()
        self._message = None
        self._subject = None
        self._cache = g_yaml_cache

        self._header = None
        self._body = None
        self._footer = None

        self.logger = logger.init_logging(self)

        self._initialize()
Ejemplo n.º 7
0
    def __init__(self):
        self.host = constants.EMAIL[sys.platform]

        # init variables
        self._sender = None
        self._recipients = Receiver()
        self._message = None
        self._subject = None
        self._cache = g_yaml_cache

        self._header = None
        self._body = None
        self._footer = None

        self.logger = logger.init_logging(self)

        self._initialize()
Ejemplo n.º 8
0
    def __init__(self, stream):
        """
        Byte reader for Photoshop files
        Photoshop file structure as follows:
        -File Header
        -Color Mode Data
        -Image Resources
        -Layer and Mask Information
        -Image Data
        :return:
        """

        # logging
        self.logger = logger.init_logging(self)
        self.logger.debug(
            'Initialized <{0}.{1} v{2} object at {3:#018x}>'.format(
                __name__, self.__class__.__name__, g_yaml_cache.get('version'),
                id(self)))

        self.stream = stream

        # start parse
        self.parse()
Ejemplo n.º 9
0
    def __init__(self, stream):
        """
        Byte reader for Photoshop files
        Photoshop file structure as follows:
        -File Header
        -Color Mode Data
        -Image Resources
        -Layer and Mask Information
        -Image Data
        :return:
        """

        # logging
        self.logger = logger.init_logging(self)
        self.logger.debug('Initialized <{0}.{1} v{2} object at {3:#018x}>'.format(__name__,
                                                                                  self.__class__.__name__,
                                                                                  g_yaml_cache.get('version'),
                                                                                  id(self)))

        self.stream = stream

        # start parse
        self.parse()