Mercurial > repos > iuc > simpleweather
annotate ansi2html.sh @ 0:d2dd051f072b draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
author | iuc |
---|---|
date | Tue, 19 Jul 2016 11:55:14 -0400 |
parents | |
children |
rev | line source |
---|---|
0
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
1 #!/bin/sh |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
3 # Convert ANSI (terminal) colours and attributes to HTML |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
4 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
5 # Licence: LGPLv2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
6 # Author: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
7 # http://www.pixelbeat.org/docs/terminal_colours/ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
8 # Examples: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
9 # ls -l --color=always | ansi2html.sh > ls.html |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
10 # git show --color | ansi2html.sh > last_change.html |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
11 # Generally one can use the `script` util to capture full terminal output. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
12 # Changes: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
13 # V0.1, 24 Apr 2008, Initial release |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
14 # V0.2, 01 Jan 2009, Phil Harnish <philharnish@gmail.com> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
15 # Support `git diff --color` output by |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
16 # matching ANSI codes that specify only |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
17 # bold or background colour. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
18 # P@draigBrady.com |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
19 # Support `ls --color` output by stripping |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
20 # redundant leading 0s from ANSI codes. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
21 # Support `grep --color=always` by stripping |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
22 # unhandled ANSI codes (specifically ^[[K). |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
23 # V0.3, 20 Mar 2009, http://eexpress.blog.ubuntu.org.cn/ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
24 # Remove cat -v usage which mangled non ascii input. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
25 # Cleanup regular expressions used. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
26 # Support other attributes like reverse, ... |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
27 # P@draigBrady.com |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
28 # Correctly nest <span> tags (even across lines). |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
29 # Add a command line option to use a dark background. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
30 # Strip more terminal control codes. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
31 # V0.4, 17 Sep 2009, P@draigBrady.com |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
32 # Handle codes with combined attributes and color. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
33 # Handle isolated <bold> attributes with css. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
34 # Strip more terminal control codes. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
35 # V0.23, 28 Feb 2016 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
36 # http://github.com/pixelb/scripts/commits/master/scripts/ansi2html.sh |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
37 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
38 gawk --version >/dev/null || exit 1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
39 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
40 if [ "$1" = "--version" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
41 printf '0.23\n' && exit |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
42 fi |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
43 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
44 usage() |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
45 { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
46 printf '%s\n' \ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
47 'This utility converts ANSI codes in data passed to stdin |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
48 It has 4 optional parameters: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
49 --bg=dark --palette=linux|solarized|tango|xterm --css-only|--body-only |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
50 E.g.: ls -l --color=always | ansi2html.sh --bg=dark > ls.html' >&2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
51 exit |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
52 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
53 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
54 if [ "$1" = "--help" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
55 usage |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
56 fi |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
57 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
58 processArg() |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
59 { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
60 [ "$1" = "--bg=dark" ] && { dark_bg=yes; return; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
61 [ "$1" = "--css-only" ] && { css_only=yes; return; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
62 [ "$1" = "--body-only" ] && { body_only=yes; return; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
63 if [ "$1" = "--palette=solarized" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
64 # See http://ethanschoonover.com/solarized |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
65 P0=073642; P1=D30102; P2=859900; P3=B58900; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
66 P4=268BD2; P5=D33682; P6=2AA198; P7=EEE8D5; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
67 P8=002B36; P9=CB4B16; P10=586E75; P11=657B83; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
68 P12=839496; P13=6C71C4; P14=93A1A1; P15=FDF6E3; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
69 return; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
70 elif [ "$1" = "--palette=solarized-xterm" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
71 # Above mapped onto the xterm 256 color palette |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
72 P0=262626; P1=AF0000; P2=5F8700; P3=AF8700; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
73 P4=0087FF; P5=AF005F; P6=00AFAF; P7=E4E4E4; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
74 P8=1C1C1C; P9=D75F00; P10=585858; P11=626262; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
75 P12=808080; P13=5F5FAF; P14=8A8A8A; P15=FFFFD7; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
76 return; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
77 elif [ "$1" = "--palette=tango" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
78 # Gnome default |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
79 P0=000000; P1=CC0000; P2=4E9A06; P3=C4A000; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
80 P4=3465A4; P5=75507B; P6=06989A; P7=D3D7CF; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
81 P8=555753; P9=EF2929; P10=8AE234; P11=FCE94F; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
82 P12=729FCF; P13=AD7FA8; P14=34E2E2; P15=EEEEEC; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
83 return; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
84 elif [ "$1" = "--palette=xterm" ]; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
85 P0=000000; P1=CD0000; P2=00CD00; P3=CDCD00; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
86 P4=0000EE; P5=CD00CD; P6=00CDCD; P7=E5E5E5; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
87 P8=7F7F7F; P9=FF0000; P10=00FF00; P11=FFFF00; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
88 P12=5C5CFF; P13=FF00FF; P14=00FFFF; P15=FFFFFF; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
89 return; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
90 else # linux console |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
91 P0=000000; P1=AA0000; P2=00AA00; P3=AA5500; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
92 P4=0000AA; P5=AA00AA; P6=00AAAA; P7=AAAAAA; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
93 P8=555555; P9=FF5555; P10=55FF55; P11=FFFF55; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
94 P12=5555FF; P13=FF55FF; P14=55FFFF; P15=FFFFFF; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
95 [ "$1" = "--palette=linux" ] && return; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
96 fi |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
97 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
98 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
99 processArg #defaults |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
100 for var in "$@"; do processArg $var; done |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
101 [ "$css_only" ] && [ "$body_only" ] && usage |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
102 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
103 # Mac OSX's GNU sed is installed as gsed |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
104 # use e.g. homebrew 'gnu-sed' to get it |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
105 if ! sed --version >/dev/null 2>&1; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
106 if gsed --version >/dev/null 2>&1; then |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
107 alias sed=gsed |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
108 else |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
109 echo "Error, can't find an acceptable GNU sed." >&2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
110 exit 1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
111 fi |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
112 fi |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
113 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
114 [ "$css_only" ] || [ "$body_only" ] || printf '%s' "<html> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
115 <head> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
116 <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
117 <style type=\"text/css\"> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
118 " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
119 [ "$body_only" ] || printf ".ef0,.f0 { color: #$P0; } .eb0,.b0 { background-color: #$P0; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
120 .ef1,.f1 { color: #$P1; } .eb1,.b1 { background-color: #$P1; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
121 .ef2,.f2 { color: #$P2; } .eb2,.b2 { background-color: #$P2; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
122 .ef3,.f3 { color: #$P3; } .eb3,.b3 { background-color: #$P3; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
123 .ef4,.f4 { color: #$P4; } .eb4,.b4 { background-color: #$P4; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
124 .ef5,.f5 { color: #$P5; } .eb5,.b5 { background-color: #$P5; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
125 .ef6,.f6 { color: #$P6; } .eb6,.b6 { background-color: #$P6; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
126 .ef7,.f7 { color: #$P7; } .eb7,.b7 { background-color: #$P7; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
127 .ef8, .f0 > .bold,.bold > .f0 { color: #$P8; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
128 .ef9, .f1 > .bold,.bold > .f1 { color: #$P9; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
129 .ef10,.f2 > .bold,.bold > .f2 { color: #$P10; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
130 .ef11,.f3 > .bold,.bold > .f3 { color: #$P11; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
131 .ef12,.f4 > .bold,.bold > .f4 { color: #$P12; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
132 .ef13,.f5 > .bold,.bold > .f5 { color: #$P13; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
133 .ef14,.f6 > .bold,.bold > .f6 { color: #$P14; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
134 .ef15,.f7 > .bold,.bold > .f7 { color: #$P15; font-weight: normal; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
135 .eb8 { background-color: #$P8; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
136 .eb9 { background-color: #$P9; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
137 .eb10 { background-color: #$P10; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
138 .eb11 { background-color: #$P11; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
139 .eb12 { background-color: #$P12; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
140 .eb13 { background-color: #$P13; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
141 .eb14 { background-color: #$P14; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
142 .eb15 { background-color: #$P15; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
143 " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
144 # The default xterm 256 colour palette |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
145 for red in 0 1 2 3 4 5 ; do |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
146 for green in 0 1 2 3 4 5 ; do |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
147 for blue in 0 1 2 3 4 5 ; do |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
148 c=$((16 + ($red * 36) + ($green * 6) + $blue)) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
149 r=$((($red * 40 + 55) * ($red > 0))) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
150 g=$((($green * 40 + 55) * ($green > 0))) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
151 b=$((($blue * 40 + 55) * ($blue > 0))) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
152 [ "$body_only" ] || printf ".ef%d { color: #%2.2x%2.2x%2.2x; } " $c $r $g $b |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
153 [ "$body_only" ] || printf ".eb%d { background-color: #%2.2x%2.2x%2.2x; }\n" $c $r $g $b |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
154 done |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
155 done |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
156 done |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
157 for gray in $(seq 0 23); do |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
158 c=$(($gray+232)) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
159 l=$(($gray*10 + 8)) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
160 [ "$body_only" ] || printf ".ef%d { color: #%2.2x%2.2x%2.2x; } " $c $l $l $l |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
161 [ "$body_only" ] || printf ".eb%d { background-color: #%2.2x%2.2x%2.2x; }\n" $c $l $l $l |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
162 done |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
163 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
164 [ "$body_only" ] || printf '%s' ' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
165 .f9 { color: '`[ "$dark_bg" ] && printf "#$P7;" || printf "#$P0;"`' } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
166 .b9 { background-color: #'`[ "$dark_bg" ] && printf $P0 || printf $P15`'; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
167 .f9 > .bold,.bold > .f9, body.f9 > pre > .bold { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
168 /* Bold is heavy black on white, or bright white |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
169 depending on the default background */ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
170 color: '`[ "$dark_bg" ] && printf "#$P15;" || printf "#$P0;"`' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
171 font-weight: '`[ "$dark_bg" ] && printf 'normal;' || printf 'bold;'`' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
172 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
173 .reverse { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
174 /* CSS does not support swapping fg and bg colours unfortunately, |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
175 so just hardcode something that will look OK on all backgrounds. */ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
176 '"color: #$P0; background-color: #$P7;"' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
177 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
178 .underline { text-decoration: underline; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
179 .line-through { text-decoration: line-through; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
180 .blink { text-decoration: blink; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
181 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
182 /* Avoid pixels between adjacent span elements. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
183 Note this only works for lines less than 80 chars |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
184 where we close span elements on the same line. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
185 span { display: inline-block; } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
186 */ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
187 ' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
188 [ "$body_only" ] || [ "$css_only" ] && printf '%s\n' \ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
189 'To use the css generated from --css-only, do: '\ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
190 '<head><link rel="stylesheet" type="text/css" href="style.css"></head>' >&2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
191 [ "$css_only" ] && exit |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
192 [ "$body_only" ] || printf '%s' '</style> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
193 </head> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
194 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
195 <body class="f9 b9"> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
196 <pre> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
197 ' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
198 [ "$body_only" ] && printf '%s\n' 'Be sure to use <body class="f9 b9"> and <pre>' >&2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
199 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
200 p='\x1b\[' #shortcut to match escape codes |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
201 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
202 # Handle various xterm control sequences. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
203 # See /usr/share/doc/xterm-*/ctlseqs.txt |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
204 sed " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
205 # escape ampersand and quote |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
206 s#&#\&#g; s#\"#\"#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
207 s#\x1b[^\x1b]*\x1b\\\##g # strip anything between \e and ST |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
208 s#\x1b][0-9]*;[^\a]*\a##g # strip any OSC (xterm title etc.) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
209 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
210 s#\r\$## # strip trailing \r |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
211 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
212 # strip other non SGR escape sequences |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
213 s#[\x07]##g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
214 s#\x1b[]>=\][0-9;]*##g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
215 s#\x1bP+.\{5\}##g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
216 # Mark cursor positioning codes \"Jr;c; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
217 s#${p}\([0-9]\{1,2\}\)G#\"J;\1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
218 s#${p}\([0-9]\{1,2\}\);\([0-9]\{1,2\}\)H#\"J\1;\2;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
219 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
220 # Mark clear as \"Cn where n=1 is screen and n=0 is to end-of-line |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
221 s#${p}H#\"C1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
222 s#${p}K#\"C0;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
223 # Mark Cursor move columns as \"Mn where n is +ve for right, -ve for left |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
224 s#${p}C#\"M1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
225 s#${p}\([0-9]\{1,\}\)C#\"M\1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
226 s#${p}\([0-9]\{1,\}\)D#\"M-\1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
227 s#${p}\([0-9]\{1,\}\)P#\"X\1;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
228 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
229 s#${p}[0-9;?]*[^0-9;?m]##g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
230 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
231 " | |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
232 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
233 # Normalize the input before transformation |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
234 sed " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
235 # escape HTML (ampersand and quote done above) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
236 s#>#\>#g; s#<#\<#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
237 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
238 # normalize SGR codes a little |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
239 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
240 # split 256 colors out and mark so that they're not |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
241 # recognised by the following 'split combined' line |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
242 :e |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
243 s#${p}\([0-9;]\{1,\}\);\([34]8;5;[0-9]\{1,3\}\)m#${p}\1m${p}¬\2m#g; t e |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
244 s#${p}\([34]8;5;[0-9]\{1,3\}\)m#${p}¬\1m#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
245 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
246 :c |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
247 s#${p}\([0-9]\{1,\}\);\([0-9;]\{1,\}\)m#${p}\1m${p}\2m#g; t c # split combined |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
248 s#${p}0\([0-7]\)#${p}\1#g #strip leading 0 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
249 s#${p}1m\(\(${p}[4579]m\)*\)#\1${p}1m#g #bold last (with clr) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
250 s#${p}m#${p}0m#g #add leading 0 to norm |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
251 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
252 # undo any 256 color marking |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
253 s#${p}¬\([34]8;5;[0-9]\{1,3\}\)m#${p}\1m#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
254 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
255 # map 16 color codes to color + bold |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
256 s#${p}9\([0-7]\)m#${p}3\1m${p}1m#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
257 s#${p}10\([0-7]\)m#${p}4\1m${p}1m#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
258 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
259 # change 'reset' code to \"R |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
260 s#${p}0m#\"R;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
261 " | |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
262 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
263 # Convert SGR sequences to HTML |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
264 sed " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
265 # common combinations to minimise html (optional) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
266 :f |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
267 s#${p}3[0-7]m${p}3\([0-7]\)m#${p}3\1m#g; t f |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
268 :b |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
269 s#${p}4[0-7]m${p}4\([0-7]\)m#${p}4\1m#g; t b |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
270 s#${p}3\([0-7]\)m${p}4\([0-7]\)m#<span class=\"f\1 b\2\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
271 s#${p}4\([0-7]\)m${p}3\([0-7]\)m#<span class=\"f\2 b\1\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
272 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
273 s#${p}1m#<span class=\"bold\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
274 s#${p}4m#<span class=\"underline\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
275 s#${p}5m#<span class=\"blink\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
276 s#${p}7m#<span class=\"reverse\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
277 s#${p}9m#<span class=\"line-through\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
278 s#${p}3\([0-9]\)m#<span class=\"f\1\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
279 s#${p}4\([0-9]\)m#<span class=\"b\1\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
280 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
281 s#${p}38;5;\([0-9]\{1,3\}\)m#<span class=\"ef\1\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
282 s#${p}48;5;\([0-9]\{1,3\}\)m#<span class=\"eb\1\">#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
283 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
284 s#${p}[0-9;]*m##g # strip unhandled codes |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
285 " | |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
286 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
287 # Convert alternative character set and handle cursor movement codes |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
288 # Note we convert here, as if we do at start we have to worry about avoiding |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
289 # conversion of SGR codes etc., whereas doing here we only have to |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
290 # avoid conversions of stuff between &...; or <...> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
291 # |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
292 # Note we could use sed to do this based around: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
293 # sed 'y/abcdefghijklmnopqrstuvwxyz{}`~/▒␉␌␍␊°±␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥π£◆·/' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
294 # However that would be very awkward as we need to only conv some input. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
295 # The basic scheme that we do in the awk script below is: |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
296 # 1. enable transliterate once "T1; is seen |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
297 # 2. disable once "T0; is seen (may be on diff line) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
298 # 3. never transliterate between &; or <> chars |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
299 # 4. track x,y movements and active display mode at each position |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
300 # 5. buffer line/screen and dump when required |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
301 sed " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
302 # change 'smacs' and 'rmacs' to \"T1 and \"T0 to simplify matching. |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
303 s#\x1b(0#\"T1;#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
304 s#\x0E#\"T1;#g; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
305 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
306 s#\x1b(B#\"T0;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
307 s#\x0F#\"T0;#g |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
308 " | |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
309 ( |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
310 gawk ' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
311 function dump_line(l,del,c,blanks,ret) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
312 for(c=1;c<maxX;c++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
313 if ((c SUBSEP l) in attr || length(cur)) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
314 ret = ret blanks fixas(cur,attr[c,l]) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
315 if(del) delete attr[c,l] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
316 blanks="" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
317 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
318 if ((c SUBSEP l) in dump) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
319 ret=ret blanks dump[c,l] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
320 if(del) delete dump[c,l] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
321 blanks="" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
322 } else blanks=blanks " " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
323 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
324 if(length(cur)) ret=ret blanks |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
325 return ret |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
326 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
327 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
328 function dump_screen(l,ret) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
329 for(l=1;l<=maxY;l++) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
330 ret=ret dump_line(l,0) "\n" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
331 return ret fixas(cur, "") |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
332 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
333 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
334 function atos(a,i,ret) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
335 for(i=1;i<=length(a);i++) if(i in a) ret=ret a[i] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
336 return ret |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
337 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
338 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
339 function fixas(a,s,spc,i,attr,rm,ret) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
340 spc=length(a) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
341 l=split(s,attr,">") |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
342 for(i=1;i<=spc;i++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
343 rm=rm?rm:(a[i]!=attr[i]">") |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
344 if(rm) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
345 ret=ret "</span>" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
346 delete a[i]; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
347 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
348 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
349 for(i=1;i<l;i++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
350 attr[i]=attr[i]">" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
351 if(a[i]!=attr[i]) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
352 a[i]=attr[i] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
353 ret = ret attr[i] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
354 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
355 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
356 return ret |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
357 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
358 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
359 function encode(string,start,end,i,ret,pos,sc,buf) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
360 if(!end) end=length(string); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
361 if(!start) start=1; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
362 state=3 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
363 for(i=1;i<=length(string);i++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
364 c=substr(string,i,1) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
365 if(state==2) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
366 sc=sc c |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
367 if(c==";") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
368 c=sc |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
369 state=last_mode |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
370 } else continue |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
371 } else { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
372 if(c=="\r") { x=1; continue } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
373 if(c=="<") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
374 # Change attributes - store current active |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
375 # attributes in span array |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
376 split(substr(string,i),cord,">"); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
377 i+=length(cord[1]) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
378 span[++spc]=cord[1] ">" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
379 continue |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
380 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
381 else if(c=="&") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
382 # All goes to single position till we see a semicolon |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
383 sc=c |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
384 state=2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
385 continue |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
386 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
387 else if(c=="\b") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
388 # backspace move insertion point back 1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
389 if(spc) attr[x,y]=atos(span) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
390 x=x>1?x-1:1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
391 continue |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
392 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
393 else if(c=="\"") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
394 split(substr(string,i+2),cord,";") |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
395 cc=substr(string,i+1,1); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
396 if(cc=="T") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
397 # Transliterate on/off |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
398 if(cord[1]==1&&state==3) last_mode=state=4 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
399 if(cord[1]==0&&state==4) last_mode=state=3 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
400 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
401 else if(cc=="C") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
402 # Clear |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
403 if(cord[1]+0) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
404 # Screen - if Recording dump screen |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
405 if(dumpStatus==dsActive) ret=ret dump_screen() |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
406 dumpStatus=dsActive |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
407 delete dump |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
408 delete attr |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
409 x=y=1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
410 } else { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
411 # To end of line |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
412 for(pos=x;pos<maxX;pos++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
413 dump[pos,y]=" " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
414 if (!spc) delete attr[pos,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
415 else attr[pos,y]=atos(span) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
416 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
417 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
418 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
419 else if(cc=="J") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
420 # Jump to x,y |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
421 i+=length(cord[2])+1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
422 # If line is higher - dump previous screen |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
423 if(dumpStatus==dsActive&&cord[1]<y) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
424 ret=ret dump_screen(); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
425 dumpStatus=dsNew; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
426 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
427 x=cord[2] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
428 if(length(cord[1]) && y!=cord[1]){ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
429 y=cord[1] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
430 if(y>maxY) maxY=y |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
431 # Change y - start recording |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
432 dumpStatus=dumpStatus?dumpStatus:dsReset |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
433 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
434 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
435 else if(cc=="M") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
436 # Move left/right on current line |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
437 x+=cord[1] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
438 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
439 else if(cc=="X") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
440 # delete on right |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
441 for(pos=x;pos<=maxX;pos++) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
442 nx=pos+cord[1] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
443 if(nx<maxX) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
444 if((nx SUBSEP y) in attr) attr[pos,y] = attr[nx,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
445 else delete attr[pos,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
446 if((nx SUBSEP y) in dump) dump[pos,y] = dump[nx,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
447 else delete dump[pos,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
448 } else if(spc) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
449 attr[pos,y]=atos(span) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
450 dump[pos,y]=" " |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
451 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
452 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
453 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
454 else if(cc=="R") { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
455 # Reset attributes |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
456 while(spc) delete span[spc--] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
457 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
458 i+=length(cord[1])+2 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
459 continue |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
460 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
461 else if(state==4&&i>=start&&i<=end&&c in Trans) c=Trans[c] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
462 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
463 if(dumpStatus==dsReset) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
464 delete dump |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
465 delete attr |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
466 ret=ret"\n" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
467 dumpStatus=dsActive |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
468 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
469 if(dumpStatus==dsNew) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
470 # After moving/clearing we are now ready to write |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
471 # somthing to the screen so start recording now |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
472 ret=ret"\n" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
473 dumpStatus=dsActive |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
474 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
475 if(dumpStatus==dsActive||dumpStatus==dsOff) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
476 dump[x,y] = c |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
477 if(!spc) delete attr[x,y] |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
478 else attr[x,y] = atos(span) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
479 if(++x>maxX) maxX=x; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
480 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
481 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
482 # End of line if dumping increment y and set x back to first col |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
483 x=1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
484 if(!dumpStatus) return ret dump_line(y,1); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
485 else if(++y>maxY) maxY=y; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
486 return ret |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
487 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
488 BEGIN{ |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
489 OFS=FS |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
490 # dump screen status |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
491 dsOff=0 # Not dumping screen contents just write output direct |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
492 dsNew=1 # Just after move/clear waiting for activity to start recording |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
493 dsReset=2 # Screen cleared build new empty buffer and record |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
494 dsActive=3 # Currently recording |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
495 F="abcdefghijklmnopqrstuvwxyz{}`~" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
496 T="▒␉␌␍␊°±␋┘┐┌└┼⎺⎻─⎼⎽├┤┴┬│≤≥π£◆·" |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
497 maxX=80 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
498 delete cur; |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
499 x=y=1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
500 for(i=1;i<=length(F);i++)Trans[substr(F,i,1)]=substr(T,i,1); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
501 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
502 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
503 { $0=encode($0) } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
504 1 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
505 END { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
506 if(dumpStatus) { |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
507 print dump_screen(); |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
508 } |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
509 }' |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
510 ) |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
511 |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
512 [ "$body_only" ] || printf '</pre> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
513 </body> |
d2dd051f072b
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/weather_app commit daa27cb2061f0d1cfd0f9bdc55e7073c2543f719
iuc
parents:
diff
changeset
|
514 </html>\n' |