| 1 |
#!/usr/bin/env python
|
| 2 |
# Copyright 2001 by Paul Evans
|
| 3 |
# Sat Oct 20 01:15:11 2001 Paul Evans <pevans@users.sf.net>
|
| 4 |
# v 0.3
|
| 5 |
# This grammar is free software; you can redistribute it and/or modify
|
| 6 |
# it under the terms of the GNU General Public License as published by
|
| 7 |
# the Free Software Foundation; either version 2 of the License,
|
| 8 |
# or (at your option) any later version.
|
| 9 |
|
| 10 |
# This grammar is distributed in the hope that it will be useful,
|
| 11 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 12 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
| 13 |
# General Public License for more details.
|
| 14 |
|
| 15 |
# You should have a copy of the GNU General Public License.
|
| 16 |
# Probably you have *many* of them...
|
| 17 |
# If not, write to the Free Software Foundation,
|
| 18 |
# Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
| 19 |
#
|
| 20 |
|
| 21 |
# To use this grammar you need Kaptain. The primary web site for
|
| 22 |
# Kaptain is http://kaptain.sourceforge.net. You can download the
|
| 23 |
# latest version, documentation and other Kaptain grammars there.
|
| 24 |
#
|
| 25 |
# You may need to specify the location of your kaptain binary.
|
| 26 |
|
| 27 |
|
| 28 |
import sys, os, string
|
| 29 |
|
| 30 |
a = '''
|
| 31 |
start :framed "Axel-Kapt Download Accelerator" -> info url config local buttons filler;
|
| 32 |
|
| 33 |
info :horizontal -> txt ico;
|
| 34 |
txt -> @text(x%axel -V%);
|
| 35 |
ico -> @icon("connect_creating.png");
|
| 36 |
|
| 37 |
url "Url (you can add mirrors)" -> @string()="'''
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
b = '''";
|
| 42 |
config :horizontal "OPTIONS" -> checks term max connex search;
|
| 43 |
checks :horizontal -> proxy verb quiet;
|
| 44 |
proxy "No Proxy" -> @|" -N ";
|
| 45 |
verb "Verbose" -> @|" --verbose ";
|
| 46 |
quiet "Quiet" -> @|" -q ";
|
| 47 |
|
| 48 |
term "Terminal Type" -> @string()="xterm";
|
| 49 |
max "Max bps"-> @integer()=0;
|
| 50 |
connex :horizontal "Connections" -> @integer()=4;
|
| 51 |
search :framed "ftp Search" -> numsites | ! @ ;
|
| 52 |
numsites -> " --search=" @integer()=3;
|
| 53 |
|
| 54 |
|
| 55 |
local -> file | ! @ ;
|
| 56 |
file "Save as (optional). Choose a directory and type a filename..." -> " --output=" @directory();
|
| 57 |
|
| 58 |
buttons :horizontal "Actions" -> help mail doit quit;
|
| 59 |
help -> @preview(helpstr,"Close")="Help";
|
| 60 |
mail -> @preview(bug,"Close")="Bug Report";
|
| 61 |
doit -> @exec(axel)="Start";
|
| 62 |
#doit -> @echo(axel)="Start";
|
| 63 |
quit -> @close="Exit";
|
| 64 |
|
| 65 |
filler -> @fill(); #sometimes the bottom is obscured..
|
| 66 |
#not just in kaptain. Some other qt apps too
|
| 67 |
|
| 68 |
helpstr -> "Axel is a program that downloads a file from a FTP or HTTP \
|
| 69 |
server through multiple connection, each connection downloads its own \
|
| 70 |
part of the file. Read the manual page - axel(1) for various options";
|
| 71 |
|
| 72 |
bug -> "Please visit http://axel.alioth.debian.org/ to report bugs on axel-kapt";
|
| 73 |
|
| 74 |
axel -> term " -e axel -s " max " -n "connex proxy verb quiet search " " local " " url;
|
| 75 |
'''
|
| 76 |
try:
|
| 77 |
c = string.join(sys.argv[1:])
|
| 78 |
except:
|
| 79 |
c = ""
|
| 80 |
|
| 81 |
cmd = "echo '" + a + "'" + c + "'" + b + "'" + " | kaptain"
|
| 82 |
os.system(cmd)
|