summaryrefslogtreecommitdiff
path: root/bin/wikitrans
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2018-08-17 16:11:53 +0300
committerSergey Poznyakoff <gray@gnu.org>2018-08-17 16:11:53 +0300
commitad4a97d83528b00e76435d3d2674ff05a44bd398 (patch)
treeb2a85bcc5cd8d65a1f9c84b1b8e8e68ee3a748ff /bin/wikitrans
parentf566ec604f8753f869119389072a023cd4909e7f (diff)
downloadwikitrans-ad4a97d83528b00e76435d3d2674ff05a44bd398.tar.gz
wikitrans-ad4a97d83528b00e76435d3d2674ff05a44bd398.tar.bz2
Fix the default html_base. Update docs.
Diffstat (limited to 'bin/wikitrans')
-rwxr-xr-xbin/wikitrans10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/wikitrans b/bin/wikitrans
index adf779d..e9ab81f 100755
--- a/bin/wikitrans
+++ b/bin/wikitrans
@@ -141,7 +141,15 @@ Otherwise, ARG is name of the file to read wiki material from.
(options, args) = parser.parse_args()
if len(args) == 1:
if options.base_url:
- options.kwdict['text'] = getwiki(options.base_url + '/wiki/Special:Export/' + args[0])
+ options.kwdict['text'] = getwiki(options.base_url
+ + '/wiki/Special:Export/' + args[0])
+ m = re.match('(?:.+://)(.+?)\.(wik(?:ipedia|tionary))\.org',
+ options.base_url)
+ if m:
+ options.lang = m.group(1)
+ options.kwdict['html_base'] = options.base_url + '/wiki/'
+ if m.group(2) == 'wiktionary':
+ options.itype = 'wiktionary'
elif args[0] == '-':
options.kwdict['file'] = sys.stdin
elif re.match('^(http|ftp)s?://',args[0]):

Return to:

Send suggestions and report system problems to the System administrator.