File: README

package info (click to toggle)
wikipediafs 0.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 264 kB
  • ctags: 157
  • sloc: python: 702; sh: 26; makefile: 16
file content (195 lines) | stat: -rw-r--r-- 4,544 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
WikipediaFS
===========

View and edit Wikipedia articles as if they were real files.

Requirements
------------

Python 
Fuse
Python-Fuse

Install
-------

($ su)
# python setup.py install

Configuration
-------------

The first time WikipediaFS is run, an XML configuration file is generated in
~/.wikipediafs/config.xml. You can then edit it to add more Wikipedia or
Mediawiki-based sites. Each site has a site entry defined as follows:

<site>
    <dirname>wikipedia-fr</dirname>
    <host>fr.wikipedia.org</host>
    <basename>/w/index.php</basename>
    <username>Username</username>
    <password>Password</password>
</site>

* dirname 

Is the name of the directory through which you will access to the site.

* host

Is the host of the site.

* basename

Is the base of urls used by the site. Most of the time, it will be
/dir/where/mediawiki/is/installed/index.php. For Wikipedia, it will be
/w/index.php.

* username and password

Are optional and enable you to edit articles with your login.

It is recommended to test WikipediaFS with a test site first. You can use
mblondel.org, which is set with the default config, for this purpose.
URL : http://www.mblondel.org/mediawiki/

Mount
-----

$ mkdir ~/wfs/

$ mount.wikipediafs ~/wfs/

To run mount.wikipediafs without root privileges, you have to set the right
permissions, for /usr/bin/fusermount and /dev/fuse. For example,

# adduser your_username fuse
# chmod 4750 /usr/bin/fusermount
# chgrp fuse /dev/fuse /usr/bin/fusermount

(You must log out and log in again so that changes are taken into account.)

Unmount
-------

$ fusermount -u ~/wfs/

fstab
-----

Alternatively, you can mount WikipediaFS through fstab.

To do so, add this line to /etc/fstab:

none /mnt/wfs/ wikipediafs noauto,nouser,home=/home/your_username/

Replace noauto by auto if you want WikipediaFS to be mounted at boot.
Replace nouser by user if you want to allow simple users to use WikipediaFS.
Replace /home/your_username/ by your home directory.

The right permissions have to be set on the mounted directory (e.g. /mnt/wfs/).

Then, you can use the following commands to mount and unmount WikipediaFS:

$ mount /mnt/wfs/
# umount /mnt/wfs/

Sample usage
------------

This section demonstrates possible usage of WikipediaFS via the command
line, though it is also possible to use WikipediaFS with a graphical file
explorer.

$ mount /mnt/wfs/

WikipediaFS is now mounted in /mnt/wfs/

$ cd /mnt/wfs/

We are now at the WikipediaFS root.

$ ls
mblondel.org/  wikipedia-en/

Those are directories which have been defined in my config file.

$ ls wikipedia-en/

Nothing is listed because we have not used any file yet. This is why most of
the time you will need a terminal to run the "your_favourite_editor file_name"
command.

$ cat wikipedia-en/Japan | less

The Japan article is fetched on en.wikipedia.org and displayed.

$ ls wikipedia-en/
Japan

Japan is now listed because it has been accessed once.

$ vi mblondel.org/Test

An article can be edited with a text editor. Looking at the article with a web
browser, the changes have been performed correctly.

To give a summary to your changes, use [[Summary: a sentence summary]] in the
body of the article. It will be removed before the article is saved.

$ cp wikipedia-en/Japan ~/Desktop/

This backups the online article on the local disk.

$ cp wikipedia-en/Japan mblondel.org/

This copies the wikipedia-en article on my personal mediawiki site.

$ rm mblondel.org/Test

This only removes the article from the directory, not from the site, hopefully.

Troubleshooting
---------------

** I get the "fuse: reading device: Bad file descriptor" error

This error can be caused by a number of reasons:

1/ the fuse module is not loaded:

To test if it is loaded:
# lsmod | grep fuse

To load it:
# modprobe fuse

Add fuse to /etc/modules if you want this module to be loaded at boot.

2/ WikipediaFS may still be mounted. Unmount it first.
# umount /mount/path/


** I get the "mount: unknown filesystem type 'wikipediafs'" error

Try this:
# ln -s /usr/bin/mount.wikipediafs /sbin/mount.wikipediafs

** I need to connect through an HTTP proxy.

Please use the $http_proxy environment variable.

** I want to deal with articles with a non-ASCII file name.

Set your terminal encoding to UTF-8.

** Other

The FAQ available on the official Fuse website is worth reading.
URL : http://fuse.sourceforge.net/

License
-------

WikipediaFS is distributed under the terms of the GNU General Public
License. See the COPYING file for more information.