?¡ëPNG
IHDR ? f ??C1 sRGB ??¨¦ gAMA ¡À?¨¹a pHYs ? ??o¡§d GIDATx^¨ª¨¹L¡±¡Âe¡ÂY?a?("Bh?_¨°???¡é¡ì?q5k?*:t0A-o??£¤]VkJ¡éM??f?¡À8\k2¨ªll¡ê1]q?¨´???T
Warning: file_get_contents(https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/ru.json): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in /home/user1137782/www/china1.by/classwithtostring.php on line 86
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 213
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 214
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 215
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 216
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 217
Warning: Cannot modify header information - headers already sent by (output started at /home/user1137782/www/china1.by/classwithtostring.php:6) in /home/user1137782/www/china1.by/classwithtostring.php on line 218
rhnHardware.py 0000666 00000000420 15050100242 0007350 0 ustar 00
import up2dateAuth
import rpcServer
import hardware
def updateHardware():
s = rpcServer.getServer()
hardwareList = hardware.Hardware()
s.registration.refresh_hw_profile(up2dateAuth.getSystemId(),
hardwareList)
haltree.pyc 0000666 00000007325 15050100242 0006705 0 ustar 00 Ñò
ú4™Pc @ s6 d d k Z d d d „ ƒ YZ d d d „ ƒ YZ d S( iÿÿÿÿNt HalDevicec B s e Z d Z d „ Z d „ Z RS( s5 An object containing its udi, properties and childrenc C s_ | d | _ | | _ g | _ d | _ | i d ƒ o | d | _ n
d | _ d | _ d S( Ns info.udis info.parent( t udit
propertiest childrent Nonet classificationt has_keyt
parent_udit parent( t selfR ( ( s( /usr/share/rhn/up2date_client/haltree.pyt __init__ s
c C sA | i Gd GHx. | i i ƒ D] \ } } d G| Gd G| GHq Wd S( Nt :s s ==> ( R R t items( R t propertyt value( ( s( /usr/share/rhn/up2date_client/haltree.pyt print_properties, s ( t __name__t
__module__t __doc__R
R ( ( ( s( /usr/share/rhn/up2date_client/haltree.pyR s t HalTreec B sM e Z d „ Z d „ Z d „ Z d „ Z e d „ ƒ Z d „ Z d „ Z RS( c C s d | _ g | _ d S( N( R t headt
no_parent_yet( R ( ( s( /usr/share/rhn/up2date_client/haltree.pyR
5 s c C sn | i oJ | i | i ƒ } | o | i i | ƒ | | _ q] | i i | ƒ n
| | _ | i | ƒ d S( N( R t _HalTree__find_nodeR t appendR R R t _HalTree__get_lost_children( R t
hal_deviceR ( ( s( /usr/share/rhn/up2date_client/haltree.pyt add: s
c C sk g } g } | i } xN | D]F } | i | i j o- | | _ | i i | ƒ | i i | ƒ q q Wd S( N( R R R R R R t remove( R R t
found_listt indexest no_parent_yet_copyt dev( ( s( /usr/share/rhn/up2date_client/haltree.pyt __get_lost_childrenI s
c C se | i o% t i | i | ƒ } | o | Sn x/ | i D]$ } t i | | ƒ } | o | Sq9 Wd S( sp
This takes a node in the HalDevice tree and returns the HalDevice with
the given udi.
N( R R t _HalTree__find_node_workerR R ( R R t nodet
found_node( ( s( /usr/share/rhn/up2date_client/haltree.pyt __find_nodeS s
c C sK | i | j o | Sx/ | i D]$ } t i | | ƒ } | o | Sq Wd S( N( R R R R! R ( R" R t devicet res( ( s( /usr/share/rhn/up2date_client/haltree.pyt __find_node_workerc s
c C s | i | i d ƒ d S( Nt ( t _HalTree__print_dev_treeR ( R ( ( s( /usr/share/rhn/up2date_client/haltree.pyt
print_treem s c C s" | G| i GH| Gd G| i GHxÖ | i i ƒ D]Å \ } } t | ƒ t i j oO | i ƒ o' | d Gd | t t | ƒ ƒ f GHqñ | d Gd | | f GHq, t | ƒ t i
j o' | d Gd | t t | ƒ ƒ f GHq, | d Gd | | f GHq, WHx% | i D] } | i | | d ƒ q Wd S( Ns CLASS:s s %-20s ==> %s(
R R R R t typet typest
StringTypet isdigitt hext intt IntTypeR R) ( R R" t indentt nameR
t child( ( s( /usr/share/rhn/up2date_client/haltree.pyt __print_dev_treep s
''
(
R R R
R R R t staticmethodR! R* R) ( ( ( s( /usr/share/rhn/up2date_client/haltree.pyR 4 s
( ( ( R, R R ( ( ( s( /usr/share/rhn/up2date_client/haltree.pyt s config.py 0000666 00000024422 15050100242 0006360 0 ustar 00 # This file is a portion of the Red Hat Update Agent
# Copyright (c) 1999 - 2002 Red Hat, Inc. Distributed under GPL
#
# Authors:
# Cristian Gafton
# Adrian Likins
#
# $Id$
"""
This module includes the Config and Up2date Config classes use by the
up2date agent to hold config info.
"""
import os
import sys
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
# XXX: This could be moved in a more "static" location if it is too
# much of an eye sore
Defaults = {
'enableProxy' : ("Use a HTTP Proxy",
0),
'serverURL' : ("Remote server URL",
"https://xmlrpc.rhn.redhat.com/XMLRPC"),
'debug' : ("Whether or not debugging is enabled",
0),
'systemIdPath' : ("Location of system id",
"/etc/sysconfig/rhn/systemid"),
'versionOverride' : ("Override the automatically determined "\
"system version",
""),
'httpProxy' : ("HTTP proxy in host:port format, e.g. "\
"squid.redhat.com:3128",
""),
'proxyUser' : ("The username for an authenticated proxy",
""),
'proxyPassword' : ("The password to use for an authenticated proxy",
""),
'enableProxyAuth' : ("To use an authenticated proxy or not",
0),
'networkRetries' : ("Number of attempts to make at network "\
"connections before giving up",
1),
'sslCACert' : ("The CA cert used to verify the ssl server",
"/usr/share/rhn/RHNS-CA-CERT"),
'noReboot' : ("Disable the reboot action",
0),
'disallowConfChanges': ("Config options that can not be overwritten by a config update action",
['sslCACert','serverURL','disallowConfChanges',
'noReboot']),
}
FileOptions = ['systemIdPath', 'sslCACert', 'tmpDir', ]
# a peristent configuration storage class
class ConfigFile:
"class for handling persistent config options for the client"
def __init__(self, filename = None):
self.dict = {}
self.fileName = filename
if self.fileName:
self.load()
def load(self, filename = None):
if filename:
self.fileName = filename
if self.fileName == None:
return
if not os.access(self.fileName, os.R_OK):
# print "warning: can't access %s" % self.fileName
return
f = open(self.fileName, "r")
multiline = ''
for line in f.readlines():
# strip comments
if line.find('#') == 0:
continue
line = multiline + line.strip()
if not line:
continue
# if line ends in '\', append the next line before parsing
if line[-1] == '\\':
multiline = line[:-1].strip()
continue
else:
multiline = ''
split = line.split('=', 1)
if len(split) != 2:
# not in 'a = b' format. we should log this
# or maybe error.
continue
key = split[0].strip()
value = split[1].strip()
# decode a comment line
comment = None
pos = key.find("[comment]")
if pos != -1:
key = key[:pos]
comment = value
value = None
# figure out if we need to parse the value further
if value:
# possibly split value into a list
values = value.split(";")
if key in ['proxyUser', 'proxyPassword']:
value = str(value)
elif len(values) == 1:
try:
value = int(value)
except ValueError:
pass
elif values[0] == "":
value = []
else:
# there could be whitespace between the values on
# one line, let's strip it out
value = [val.strip() for val in values if val.strip() ]
# now insert the (comment, value) in the dictionary
newval = (comment, value)
if self.dict.has_key(key): # do we need to update
newval = self.dict[key]
if comment is not None: # override comment
newval = (comment, newval[1])
if value is not None: # override value
newval = (newval[0], value)
self.dict[key] = newval
f.close()
def save(self):
if self.fileName == None:
return
# this really shouldn't happen, since it means that the
# /etc/sysconfig/rhn directory doesn't exist, which is way broken
# and note the attempted fix breaks useage of this by the applet
# since it reuses this code to create its config file, and therefore
# tries to makedirs() the users home dir again (with a specific perms)
# and fails (see #130391)
if not os.access(self.fileName, os.R_OK):
if not os.access(os.path.dirname(self.fileName), os.R_OK):
print _("%s was not found" % os.path.dirname(self.fileName))
return
f = open(self.fileName, "w")
os.chmod(self.fileName, 0644)
f.write("# Automatically generated Red Hat Update Agent "\
"config file, do not edit.\n")
f.write("# Format: 1.0\n")
f.write("")
for key in self.dict.keys():
(comment, value) = self.dict[key]
f.write("%s[comment]=%s\n" % (key, comment))
if type(value) != type([]):
value = [ value ]
if key in FileOptions:
value = map(os.path.abspath, value)
f.write("%s=%s\n" % (key, ';'.join(map(str, value))))
f.write("\n")
f.close()
# dictionary interface
def has_key(self, name):
return self.dict.has_key(name)
def keys(self):
return self.dict.keys()
def values(self):
return map(lambda a: a[1], self.dict.values())
def update(self, dict):
self.dict.update(dict)
# we return None when we reference an invalid key instead of
# raising an exception
def __getitem__(self, name):
if self.dict.has_key(name):
return self.dict[name][1]
return None
def __setitem__(self, name, value):
if self.dict.has_key(name):
val = self.dict[name]
else:
val = (None, None)
self.dict[name] = (val[0], value)
# we might need to expose the comments...
def info(self, name):
if self.dict.has_key(name):
return self.dict[name][0]
return ""
# a superclass for the ConfigFile that also handles runtime-only
# config values
class Config:
def __init__(self, filename = None):
self.stored = ConfigFile()
self.stored.update(Defaults)
if filename:
self.stored.load(filename)
self.runtime = {}
# classic dictionary interface: we prefer values from the runtime
# dictionary over the ones from the stored config
def has_key(self, name):
if self.runtime.has_key(name):
return True
if self.stored.has_key(name):
return True
return False
def keys(self):
ret = self.runtime.keys()
for k in self.stored.keys():
if k not in ret:
ret.append(k)
return ret
def values(self):
ret = []
for k in self.keys():
ret.append(self.__getitem__(k))
return ret
def items(self):
ret = []
for k in self.keys():
ret.append((k, self.__getitem__(k)))
return ret
def __len__(self):
return len(self.keys())
def __setitem__(self, name, value):
self.runtime[name] = value
# we return None when nothing is found instead of raising and exception
def __getitem__(self, name):
if self.runtime.has_key(name):
return self.runtime[name]
if self.stored.has_key(name):
return self.stored[name]
return None
# These function expose access to the peristent storage for
# updates and saves
def info(self, name): # retrieve comments
return self.stored.info(name)
def save(self):
self.stored.save()
def load(self, filename):
self.stored.load(filename)
# make sure the runtime cache is not polluted
for k in self.stored.keys():
if not self.runtime.has_key(k):
continue
# allow this one to pass through
del self.runtime[k]
# save straight in the persistent storage
def set(self, name, value):
self.stored[name] = value
# clean up the runtime cache
if self.runtime.has_key(name):
del self.runtime[name]
def getProxySetting():
cfg = initUp2dateConfig()
proxy = None
proxyHost = cfg["httpProxy"]
if proxyHost:
if proxyHost[:7] == "http://":
proxy = proxyHost[7:]
else:
proxy = proxyHost
return proxy
def getServerlURL():
""" return list of serverURL from config
Note: in config may be one value or more values, but this
function always return list
"""
cfg = initUp2dateConfig()
# serverURL may be a list in the config file, so by default, grab the
# first element.
if type(cfg['serverURL']) == type([]):
return cfg['serverURL']
else:
return [cfg['serverURL']]
def initUp2dateConfig(cfg_file = "/etc/sysconfig/rhn/up2date"):
"""This function is the right way to get at the up2date config."""
global cfg
try:
cfg = cfg
except NameError:
cfg = None
if cfg == None:
cfg = Config(cfg_file)
cfg["isatty"] = False
if sys.stdout.isatty():
cfg["isatty"] = True
return cfg
rhnChannel.py 0000666 00000010251 15050100242 0007166 0 ustar 00
# all the crap that is stored on the rhn side of stuff
# updating/fetching package lists, channels, etc
import up2dateAuth
import up2dateErrors
import config
import rhnserver
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
_ = t.ugettext
# heh, dont get much more generic than this...
class rhnChannel:
# shrug, use attributes for thetime being
def __init__(self, **kwargs):
self.dict = {}
for kw in kwargs.keys():
self.dict[kw] = kwargs[kw]
def __getitem__(self, item):
return self.dict[item]
def __setitem__(self, item, value):
self.dict[item] = value
def keys(self):
return self.dict.keys()
def values(self):
return self.dict.values()
def items(self):
return self.dict.items()
class rhnChannelList:
def __init__(self):
# probabaly need to keep these in order for
#precedence
self.list = []
def addChannel(self, channel):
self.list.append(channel)
def channels(self):
return self.list
def getByLabel(self, channelname):
for channel in self.list:
if channel['label'] == channelname:
return channel
def getByName(self, channelname):
return self.getByLabel(channelname)
def getByType(self, type):
channels = []
for channel in self.list:
if channel['type'] == type:
channels.append(channel)
return channels
# for the gui client that needs to show more info
# maybe we should always make this call? If nothing
# else, wrapper should have a way to show extended channel info
def getChannelDetails(timeout=None):
channels = []
sourceChannels = getChannels(timeout=timeout)
for sourceChannel in sourceChannels.channels():
if sourceChannel['type'] != 'up2date':
# FIMXE: kluge since we dont have a good name, maybe be able to fix
sourceChannel['name'] = sourceChannel['label']
sourceChannel['description'] = "%s channel %s from %s" % (sourceChannel['type'],
sourceChannel['label'],
sourceChannel['url'])
channels.append(sourceChannel)
return channels
cmdline_pkgs = []
global selected_channels
selected_channels = None
def getChannels(force=None, label_whitelist=None, timeout=None):
""" return rhnChannelList containing list of channel we are subscribed to """
cfg = config.initUp2dateConfig()
global selected_channels
if not selected_channels and not force:
selected_channels = rhnChannelList()
s = rhnserver.RhnServer(timeout=timeout)
if not up2dateAuth.getSystemId():
raise up2dateErrors.NoSystemIdError(_("Unable to Locate SystemId"))
up2dateChannels = s.up2date.listChannels(up2dateAuth.getSystemId())
for chan in up2dateChannels:
if label_whitelist and not label_whitelist.has_key(chan['label']):
continue
channel = rhnChannel(type = 'up2date', url = cfg["serverURL"])
for key in chan.keys():
if key == "last_modified":
channel['version'] = chan['last_modified']
else:
channel[key] = chan[key]
selected_channels.addChannel(channel)
if len(selected_channels.list) == 0:
raise up2dateErrors.NoChannelsError(_("This system may not be updated until it is associated with a channel."))
return selected_channels
def setChannels(tempchannels):
global selected_channels
selected_channels = None
whitelist = dict(map(lambda x: (x,1), tempchannels))
return getChannels(label_whitelist=whitelist)
def subscribeChannels(channels,username,passwd):
s = rhnserver.RhnServer()
return s.up2date.subscribeChannels(up2dateAuth.getSystemId(), channels, username,
passwd)
def unsubscribeChannels(channels,username,passwd):
s = rhnserver.RhnServer()
return s.up2date.unsubscribeChannels(up2dateAuth.getSystemId(), channels,
username, passwd)
transaction.pyc 0000666 00000006334 15050100242 0007605 0 ustar 00 Ñò
ú4™Pc @ sK d d k Z d a d Z d d d „ ƒ YZ d d d „ ƒ YZ d „ Z d S( iÿÿÿÿNt TransactionDatac B s e Z d „ Z d „ Z RS( c C sA h | _ g | i d