Beispiel #1
0
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)
            writer2.write(result)
Beispiel #2
0
        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>')
    if i >= 0:
        line = line[i + 4:]
        if line.endswith('</h4>'):
            line = line[:-5]
Beispiel #3
0
		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'], 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>')
	if i >= 0:
		line = line[i + 4:]
		if line.endswith('</h4>'):