예제 #1
0
파일: Compressor.py 프로젝트: MatiasSM/fcb
 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)
예제 #2
0
파일: Settings.py 프로젝트: MatiasSM/fcb
 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)
예제 #3
0
파일: Compressor.py 프로젝트: MatiasSM/fcb
    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 = []
예제 #4
0
파일: mail.py 프로젝트: 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)
예제 #5
0
파일: PathFilter.py 프로젝트: MatiasSM/fcb
 def init(self):
     self.log = get_logger_for(self)
     self._session_resource = get_session()
예제 #6
0
파일: mail.py 프로젝트: 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
예제 #7
0
파일: mega.py 프로젝트: MatiasSM/fcb
 def __init__(self):
     self._should_stop = False
     self._log = get_logger_for(self)
예제 #8
0
파일: settings.py 프로젝트: MatiasSM/fcb
    def __init__(self, file_path):
        self.log = get_logger_for(self)
        self.mail_confs = []
        self.mega_confs = []

        self._parse(Etree.parse(file_path))