#!/usr/bin/env python3 import os manualPages = ( "kxstudio_introduction", "kxstudio_and_free_software", "downloading_and_booting_kxstudio", "installing_kxstudio", "package_management", "video_drivers", "included_and_recommended_apps", "linux_audio_overview", "alsa_and_kxstudio", "cadence_introduction", "jack_configuration", "simple_claudia_studio", "latency", "wineasio_and_reaper", "useful_links_and_getting_help" ) for page in manualPages: print(page) tmppage = "tmp_%s" % page webpage = "http://www.wiki.linuxmusicians.com/doku.php?id=%s" % page #os.system("wget %s -O %s" % (webpage, tmppage)) tmppageFd = open(tmppage, "r") tmppageRead = tmppageFd.read().strip() tmppageFd.close() # remove initial html code readPart1 = tmppageRead.split("", 1)[1].strip() # remove TOC, if any readPart2 = readPart1.split("", 1)[-1].strip() # remove final html code readPart3 = readPart2.split("", 1)[0].strip() # remove first part of the page, we want the title readPart4 = readPart3.split("

", 1)[1].split("", 1)[0].strip() # remove initial bits of html code (title) readPart5 = readPart4.split("

", 1)[1].strip() # html cleanup readPart6 = readPart5.replace("

", "") readPart7 = readPart6.replace("/lib/exe/", "http://www.wiki.linuxmusicians.com/lib/exe/") # custom mods readPart8 = readPart7.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=jack_configuration&cache=cache&media=cadence-jack-settings.png", "http://kxstudio.sourceforge.net/screenshots/cadence-jacksettings2.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=cadence-jack-settings.png", "http://kxstudio.sourceforge.net/screenshots/cadence-jacksettings2.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=cadence_introduction&cache=cache&media=cadence.png", "http://kxstudio.sourceforge.net/screenshots/cadence1.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=cadence.png", "http://kxstudio.sourceforge.net/screenshots/cadence1.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=simple_claudia_studio&cache=cache&media=claudia2.png", "http://kxstudio.sourceforge.net/screenshots/claudia-qtractor.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=claudia2.png", "http://kxstudio.sourceforge.net/screenshots/claudia-qtractor.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/detail.php?id=alsa_and_kxstudio&cache=cache&media=kmixer.png", "http://kxstudio.sourceforge.net/screenshots/kmix.png") readPart8 = readPart8.replace("http://www.wiki.linuxmusicians.com/lib/exe/fetch.php?w=&h=&cache=cache&media=kmixer.png", "http://kxstudio.sourceforge.net/screenshots/kmix.png") readPart8 = readPart8.replace(" The 'UAC3553B' tab displays controls for a USB audio device whilst 'Playback Streams' can be ignored unless you are using PulseAudio.", "") readPart8 = readPart8.replace("as 'Mic' and 'Mic Boost' do", "as 'Beep' does") readPart8 = readPart8.replace("/Documentation:Manual:") kxPageContent = '\n' kxPageContent += '\n' kxPageContent += readPart8 kxPageContent += '\n' kxPageContent += '\n' kxPageContent += '


\n' kxPageContent += '\n' kxPageContent += '\n' pageFd = open("Documentation:Manual:%s.php" % page, "w") pageFd.write(kxPageContent) pageFd.close()