def do(destPath): sdo = { 'configDestinationPath': destPath + 'share-desktop-ontologies.cfg', 'sectionName': 'shared-desktop-ontologies', 'name': 'shared-desktop-ontologies', 'web': 'http://oscaf.sourceforge.net/', 'source_path': 'shared-desktop-ontologies', 'cvs': ('git', 'git://oscaf.git.sourceforge.net/gitroot/oscaf/shared-desktop-ontologies') } libdbusmenuqt = { 'configDestinationPath': destPath + 'libdbusmenu-qt.cfg', 'sectionName': 'libdbusmenu-qt', 'name': 'libdbusmenu-qt', 'web': 'https://launchpad.net/libdbusmenu-qt', 'source_path': 'libdbusmenu-qt', 'cvs': ('bzr', 'lp:libdbusmenu-qt') } l = [] l.append(sdo) l.append(libdbusmenuqt) for i in l: cfgW = CfgWriter() cfgW.configDestinationPath = i['configDestinationPath'] cfgW.sectionName = i['sectionName'] cfgW.name = i['name'] cfgW.web = i['web'] cfgW.source_path = i['source_path'] cfgW.cvs = i['cvs'][0], i['cvs'][1] #create the config! cfgW.write()
def do(destPath): artwork = { 'configDestinationPath': destPath + 'kdeartwork.cfg', 'sectionName': 'kdeartwork', 'name': 'kdeartwork', 'web': 'http://websvn.kde.org/trunk/KDE/kdeartwork/', 'source_path': 'kdeartwork', 'cvs': ('svn', 'svn://anonsvn.kde.org/home/kde/trunk/KDE/kdeartwork') } wallpaper = { 'configDestinationPath': destPath + 'kde-wallpapers.cfg', 'sectionName': 'kde-wallpapers', 'name': 'kde-wallpapers', 'web': 'http://websvn.kde.org/trunk/KDE/kde-wallpapers/', 'source_path': 'kde-wallpapers', 'cvs': ('svn', 'svn://anonsvn.kde.org/home/kde/trunk/KDE/kde-wallpapers') } l = [] l.append(artwork) l.append(wallpaper) for i in l: cfgW = CfgWriter() cfgW.configDestinationPath = i['configDestinationPath'] cfgW.sectionName = i['sectionName'] cfgW.name = i['name'] cfgW.web = i['web'] cfgW.source_path = i['source_path'] cfgW.cvs = i['cvs'][0], i['cvs'][1] #create the config! cfgW.write()
def _moduleConfigFiles(self): for module in self.soup.find_all("module"): try: modulePath = module.path.string.split('/') except AttributeError: continue for release in self.releases: if modulePath[0] == release: moduleDir = self.configPath + modulePath[0] + '/' if not path.exists(moduleDir): mkdir(moduleDir) #check if modulePath[1] is a dir or not. #for instance kde/kdelibs.cfg it isn't #but extragear/base/ is. configFilePath = '' moduleDir += modulePath[1] if not path.isdir(moduleDir): configFilePath = moduleDir + '.cfg' cfgW = CfgWriter() cfgW.configDestinationPath = configFilePath cfgW.sectionName = modulePath[1] #the attribute name already exists, so we will take its value #with a different way cfgW.name = module.find('name').string.encode('latin1').strip() cfgW.web = module.web.string cfgW.source_path = module.path.string try: cfgW.cvs = 'git', module.repo.url.string except AttributeError: pass #create the config! cfgW.write()
def _componentConfigFiles(self): for component in self.soup.find_all("component"): componentPath = component.path.string.split('/') if componentPath[0] != 'calligra': continue #something like config/calligra/calligra.cfg configFilePath = self.configPath + 'calligra/' + 'calligra.cfg' cfgW = CfgWriter() cfgW.configDestinationPath = configFilePath cfgW.sectionName = componentPath[0] #the attribute name already exists, so we will take its value #with a different way print component.find('name').string.encode('latin1').strip() cfgW.name = component.find('name').string.encode('latin1').strip() cfgW.web = component.web.string cfgW.source_path = component.path.string cfgW.cvs = 'git', component.repo.url.string #create the config! cfgW.write()
def _projectConfigFiles(self): for project in self.soup.find_all("project"): try: projectPath = project.path.string.split('/') except AttributeError: continue for release in self.releases: #include only the projects for which we want their data, #those are the ones which live under the elements of self.releases if projectPath[0] == release: #the kde release is an exception if projectPath[0] == 'kde': configFilePath = self.configPath + projectPath[0] + '/' + projectPath[1] + '.cfg' cfgW = CfgWriter() cfgW.configDestinationPath = configFilePath cfgW.sectionName = projectPath[2] #the attribute name already exists, so we will take its value #with a different way cfgW.name = project.find('name').string.strip() cfgW.web = project.web.string cfgW.source_path = project.path.string cfgW.cvs = 'git', project.repo.url.string #create the config! cfgW.write() else: if len(projectPath) == 4: #extragear/network/ directory = self.configPath + projectPath[0] + '/' + projectPath[1] + '/' #create the dir if not path.exists(directory): mkdir(directory) #extragear/network/telepathy.cfg configFilePath = directory + projectPath[2] + '.cfg' cfgW = CfgWriter() cfgW.configDestinationPath = configFilePath cfgW.sectionName = projectPath[2] #the attribute name already exists, so we will take its value #with a different way cfgW.name = project.find('name').string.strip() cfgW.web = project.web.string cfgW.source_path = project.path.string cfgW.cvs = 'git', project.repo.url.string #create the config! cfgW.write() elif len(projectPath) == 3: #playground/base/ dirPath = self.configPath + projectPath[0] + '/' + projectPath[1] + '/' if not path.exists(dirPath): mkdir(dirPath) configFilePath = dirPath + projectPath[2] + '.cfg' cfgW = CfgWriter() cfgW.configDestinationPath = configFilePath cfgW.sectionName = projectPath[2] #the attribute name already exists, so we will take its value #with a different way cfgW.name = project.find('name').string.encode('latin1').strip() cfgW.web = project.web.string cfgW.source_path = project.path.string cfgW.cvs = 'git', project.repo.url.string #create the config! cfgW.write()