Package pulp :: Package client :: Module repolib :: Class RepoFile
[hide private]
[frames] | no frames]

Class RepoFile

source code

iniparse.ConfigParser --+
                        |
                       RepoFile

Represents a .repo file and is primarily a wrapper around iniparse to get around its short comings and understand Repo objects.

Instance Methods [hide private]
 
__init__(self, name='pulp.repo') source code
 
read(self)
Read and parse the file.
source code
 
write(self)
Write the file.
source code
 
add(self, repo)
Add a repo and create section if needed.
source code
RepoFile
delete(self, section)
Delete a section (repo name).
source code
 
update(self, repo)
Update the repo section using the specified repo.
source code
Repo
section(self, section)
Get a Repo (section) by name.
source code
 
create(self)
Create the .repo file with appropriate header/footer if it does not already exist.
source code
Class Variables [hide private]
str PATH = '/etc/yum.repos.d/'
The absolute path to a .repo file.
Method Details [hide private]

__init__(self, name='pulp.repo')
(Constructor)

source code 
Parameters:
  • name (str) - The absolute path to a .repo file.

add(self, repo)

source code 

Add a repo and create section if needed.

Parameters:
  • repo (Repo) - A repo to add.

delete(self, section)

source code 

Delete a section (repo name).

Returns: RepoFile
self

update(self, repo)

source code 

Update the repo section using the specified repo.

Parameters:
  • repo (Repo) - A repo used to update.

section(self, section)

source code 

Get a Repo (section) by name.

Parameters:
  • section (str) - A section (repo) name.
Returns: Repo
A repo for the section name.