Sublime Forum

Anyone using Mediawiker?

#1

Hello, I was wondering if anyone is using the Plugin Mediawiker?

Because i can’t seem to get it to work with a local installation of MediaWiki (via Xampp). Although it works wonderfully for regular Wikipedia entries!

Has anyone ever tried to get this plugin to work with a local installation and has any hints? I have not yet customized any settings of MediaWiki.

Thanks!

0 Likes

#2

I’m tried to check plugin with my local wiki site - all working correctly.
Can you post the errors from console and your config entries?

0 Likes

#3

First of all, please, check the api of your wiki, it must be enabled and url like
yourdomain.com/wiki_api_path/api.php
(for example en.wikipedia.org/w/api.php)
must show api page…

0 Likes

#4

This is what i get in the console:

Traceback (most recent call last): File ".\sublime_plugin.py", line 356, in run_ File ".\mediawiker.py", line 371, in run File ".\mediawiker.py", line 75, in mw_get_page_text AttributeError: 'NoneType' object has no attribute 'Pages'

I have a Page called “Testpage” in my Wiki, when i open it, the Url is “localhost/mediawiki/index.php/Testpage”; the Api Url is “localhost/mediawiki/api.php” (shows the api documentation page)

My connection string in sublime text is :

		"MyWiki":
		{
			"domain": "",
			"host": "localhost",
			"pagepath": "/mediawiki/index.php/",
			"password": "something,
			"path": "/mediawiki/",
			"username": "something"
		},

$wgEnableWriteAPI and $wgEnableAPI are both set true in DefaultSettings.php.

What am i missing here?

0 Likes

#5

And “MyWiki” activated as current site?

“mediawiki_site_active”: “MyWiki”
You can do it from menu… “select wiki”

0 Likes

#6

Yes, i have done that… As i was saying, it works for Wikipedia, but when i try to open a page from my local MediaWiki, i just get an “untitled” new tab.

0 Likes

#7

Ok, apparently i just fixed it… It is a bit embarassing, but the Username in MediaWiki is case-sensitive, which i neglected in Sublime Text. Seems to work now :wink:

Thanks for a creating a really cool plugin!

0 Likes

#8

Yes, username is case-sensitive.
Strange, on incorrect authorization, “Login failed…” message must be shown in status line.
I will check it…

Thank you!

0 Likes

#9

Hi,

First of all, thank you very much for the pluggin.
If it works as expected ( :smile: ), it will be very usefully for me.

Anyway, I am open this query because i am unable to open a WikiPage that I have on my server.

<----- The MediaWiki API pag. is fine ----->
192.168.145.21/api.php

<----- The file that i am trying to open with sublime is the following----->
192.168.145.21/index.php/Temporal

<----- My Mediawiker.sublime-settings is the following----->

"mediawiki_site":
    {
        ...
        "my_wiki":
            {
                "host": "192.168.145.21",
                "path": "",
                "pagepath": "",
                "username": "...",
                "password": "...",
                "domain": ""
        }
    },
    "mediawiki_site_active": "my_wiki",

<— When I opened the “Temporal” page, i saw the following in console—>

Traceback (most recent call last):
  File "./sublime_plugin.py", line 356, in run_
  File "./mediawiker.py", line 410, in run
  File "./mediawiker.py", line 65, in mw_get_connect
  File "./mwclient/client.py", line 113, in __init__
    self.site_init()
  File "./mwclient/client.py", line 120, in site_init
    meta = self.api('query', meta='siteinfo|userinfo', siprop='general|namespaces', uiprop='groups|rights')
  File "./mwclient/client.py", line 183, in api
    info = self.raw_api(action, **kwargs)
  File "./mwclient/client.py", line 280, in raw_api
    json_data = self.raw_call('api', data).read()
  File "./mwclient/client.py", line 249, in raw_call
    stream = self.connection.post(self.host, url, data=data, headers=headers)
  File "./mwclient/httpmw.py", line 274, in post
    return self.find_connection(host).post(host, path, headers, data)
  File "./mwclient/httpmw.py", line 202, in post
    return self.request('POST', host, path, headers, data)
  File "./mwclient/httpmw.py", line 192, in request
    raise errors.HTTPStatusError(res.status, res)
mwclient.errors.HTTPStatusError: (400, <httplib.HTTPResponse instance at 0x10807c5a8>) <--------- HTTPStatusError: 400 ??

Do you have any suggestion?
Can you please help me?

Thanks in advance.
Rui

0 Likes

#10

OK. now is fine :smile:

Changes:

                "path": "/",
                "pagepath": "/",
0 Likes