Example #1
0
 def __init__(self, sender_spec, should_split_small_files, global_quota):
     self.log = get_logger_for(self)
     self._max_container_content_size_in_bytes = sender_spec.restrictions.max_container_content_size_in_bytes
     self._max_files_per_container = sender_spec.restrictions.max_files_per_container
     self._should_split_small_files = should_split_small_files
     self._global_quota = global_quota
     self._specific_quota = Quota(quota_limit=sender_spec.restrictions.max_upload_per_day_in_bytes,
                                  be_thread_safe=False,  # will only be accessed by this instance
                                  used_quota=sender_spec.bytes_uploaded_today)
Example #2
0
 def __init__(self, sender_settings):
     log = get_logger_for(self)
     self.restrictions = _SenderRestriction(sender_settings)
     self.destinations = deepcopy(sender_settings.destinations)
     with get_session() as session:
         self.bytes_uploaded_today = \
             FilesDestinations.get_bytes_uploaded_in_date(session, self.destinations)
     log.info("According to the logs, it were already uploaded today %d bytes for destinations %s",
              self.bytes_uploaded_today,
              self.destinations)
Example #3
0
    def __init__(self, destinations):
        self.log = get_logger_for(self)
        self.destinations = destinations
        self.send_destinations = []
        self.destinations_verif_data = {}

        self._content_size = 0
        self._content_file_infos = []
        self._fragmented_files = []
        self._processed_data_file_info = None
        self._latest_file_info = None
        self.all_gen_files = []
Example #4
0
File: mail.py Project: MatiasSM/fcb
    def __init__(self):
        self._session_resource = None
        self._log = get_logger_for(self)

        file_lines = "(^File: .+\\(sha1: .*\\).*\n)+"
        empty_lines = "^(?:\n|\r\n?)*"
        self.is_content_from_fcb_regex = re.compile(''.join((
            '^\* Content:.*\n',
            file_lines,
            empty_lines,
            '^\* Tar:.*\n',
            file_lines,
            empty_lines,
            '^\* Attached:.*\n',
            file_lines
        )), re.MULTILINE)
Example #5
0
 def init(self):
     self.log = get_logger_for(self)
     self._session_resource = get_session()
Example #6
0
File: mail.py Project: MatiasSM/fcb
 def __init__(self, mail_dst):
     self._session_resource = get_session()
     self._log = get_logger_for(self)
     self._mail_dst = mail_dst
     self._last_checked_date = None
Example #7
0
File: mega.py Project: MatiasSM/fcb
 def __init__(self):
     self._should_stop = False
     self._log = get_logger_for(self)
Example #8
0
    def __init__(self, file_path):
        self.log = get_logger_for(self)
        self.mail_confs = []
        self.mega_confs = []

        self._parse(Etree.parse(file_path))