Trees | Indices | Help |
---|
|
1 # 2 # Copyright (c) 2008--2016 Red Hat, Inc. 3 # 4 # This software is licensed to you under the GNU General Public License, 5 # version 2 (GPLv2). There is NO WARRANTY for this software, express or 6 # implied, including the implied warranties of MERCHANTABILITY or FITNESS 7 # FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv2 8 # along with this software; if not, see 9 # http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt. 10 # 11 # Red Hat trademarks are not licensed under GPLv2. No permission is 12 # granted to use or replicate Red Hat trademarks that are incorporated 13 # in this software or its documentation. 14 # 15 16 # 17 # Package uploading tool 18 # 19 20 import base64 21 22 from rhnpush import connection26 user_agent = "rhnpush" 2765 7429 auth_vals = self.encode_values([username, password]) 30 self.headers["%s-%s" % (self.header_prefix, "Auth")] = auth_vals3133 self.headers["%s-%s" % (self.header_prefix, "Auth-Session")] = session_string3436 if force: 37 force = 1 38 else: 39 force = 0 40 self.headers["%s-%s" % (self.header_prefix, "Force")] = str(force)41 45 48 49 # Encodes an array of variables into Base64 (column-separated) 50 @staticmethod52 val = ':'.join([x.strip() for x in map(base64.encodestring, arr)]) 53 # Get rid of the newlines 54 val = val.replace('\n', '') 55 # And split the result into lines of fixed size 56 line_len = 80 57 result = [] 58 start = 0 59 while 1: 60 if start >= len(val): 61 break 62 result.append(val[start:start + line_len]) 63 start = start + line_len 64 return result
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Mar 4 07:37:49 2020 | http://epydoc.sourceforge.net |