Beispiel #1
0
        line = line.strip()
        if line == 'machine ' + host:
            found = True
        elif found == False:
            continue
        elif line.startswith('login '):
            user = line[6:]
        elif line.startswith('password '):
            password = line[9:]
        elif line.startswith('machine '):
            break
    f.close()

from fiji import MediaWikiClient

client = MediaWikiClient(url)
if user != None and password != None and not client.isLoggedIn():
    client.logIn(user, password)
response = client.sendRequest(
    ['title', 'Special:RecentChanges', 'hidebots', '0'], None)
if client.isLoggedIn():
    client.logOut()
'''
f = open('a1', 'r')
response = ''.join(f.readlines())
f.close()
'''

result = ''
for line in response.split('\n'):
    i = line.find('<h4>')
Beispiel #2
0
    sys.argv = sys.argv[:1] + sys.argv[2:]

if len(sys.argv) < 2:
    fiji_folder = os.path.curdir
else:
    fiji_folder = sys.argv[1]

# Create the tree
createPluginsTree(fiji_folder)

# Output it
result = pluginsTreeToString()
if uploadToWiki or compareToWiki:
    from fiji import MediaWikiClient

    client = MediaWikiClient(URL)
    wiki = client.sendRequest(['title', PAGE, 'action', 'edit'], None)
    begin = wiki.find('<textarea')
    begin = wiki.find('>', begin) + 1
    end = wiki.find('</textarea>', begin)
    wiki = wiki[begin:end].replace('&lt;', '<')
    if wiki != result:
        if compareToWiki:
            from fiji import SimpleExecuter
            from java.io import File, FileWriter
            file1 = File.createTempFile('PluginList', '.wiki')
            writer1 = FileWriter(file1)
            writer1.write(wiki)
            writer1.close()
            file2 = File.createTempFile('PluginList', '.wiki')
            writer2 = FileWriter(file2)