/usr/lib/python3/dist-packages/brebis/identifylimitations.py is in brebis 0.10-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | # -*- coding: utf-8 -*-
# Copyright © 2015 Carl Chenet <chaica@brebisproject.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Identify limitations for this archive type given the checks asked by the user
'''Identify limitations for this archive type given the
checks asked by the user'''
import logging
class IdentifyLimitations:
'''Identify limitations for this archive type given the
checks asked by the user'''
def __init__(self, __arcpath, __arctype, __data):
self.__data = __data
self.__arcpath = __arcpath
self.__main(__arctype)
def __main(self, __arctype):
'''Main for IdentifyLimitations'''
getattr(self, ''.join(['_IdentifyLimitations__study_', __arctype]))()
def __study_gz(self):
'''Study the required checks for the gzip archive type'''
__unsupported_gz = {'uid', 'gid', 'mode', 'target', 'mtime'}
for __param in self.__data:
if __param in __unsupported_gz:
self.__warn(__param)
def __study_bz2(self):
'''Study the required checks for the gzip archive type'''
__unsupported_bz2 = {'uid', 'gid', 'mode', 'equals', 'biggerthan', 'smallerthan', 'target' 'mtime'}
for __param in self.__data:
if __param in __unsupported_bz2:
self.__warn(__param)
def __study_zip(self):
'''Study the required checks for the zip archive type'''
__unsupported_zip = {'target'}
for __param in self.__data:
if __param in __unsupported_zip:
self.__warn(__param)
def __study_lzma(self):
'''Study the required checks for the lzma archive type'''
# seems pretty hard to get xz/lzma archive size - maybe in another release
__unsupported_lzma = {'uid', 'gid', 'mode', 'equals', 'biggerthan', 'smallerthan', 'target', 'mtime'}
for __param in self.__data:
if __param in __unsupported_lzma:
self.__warn(__param)
def __warn(self, __param):
'''Warn the user that parameter is not supported by message in logging'''
logging.warning('{}: The required parameter {} is not supported by this type of archive. Ignoring it.'.format(self.__arcpath, __param))
|