flnews_post_proc 1.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/version.rb ADDED
@@ -0,0 +1,21 @@
1
+ #encoding: UTF-8
2
+ =begin
3
+ /***************************************************************************
4
+ * 2023-2024, Michael Uplawski <michael.uplawski@uplawski.eu> *
5
+ * This program is free software; you can redistribute it and/or modify *
6
+ * it under the terms of the WTFPL 2.0 or later, see *
7
+ * http://www.wtfpl.net/about/ *
8
+ * *
9
+ * This program is distributed in the hope that it will be useful, *
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
12
+ * *
13
+ ***************************************************************************/
14
+ =end
15
+
16
+ PROGNAME = 'flnews_post_proc'
17
+ PROGVERSION = "1.40"
18
+ AUTHORS = "Michael Uplawski"
19
+ EMAIL = "michael.uplawski@uplawski.eu"
20
+ YEARS = "2023 - 2024"
21
+ SUMMARY = "Moved the override-dialog scripts from the executables directory to lib"
data/lib/whiptail_dlg ADDED
@@ -0,0 +1,79 @@
1
+ #!/bin/bash
2
+
3
+ #/**************************************************************************
4
+ #* This program is free software; you can redistribute it and/or modify *
5
+ #* it under the terms of the WTFPL 2.0 or later, see *
6
+ #* http://www.wtfpl.net/about/ *
7
+ #* *
8
+ #* This program is distributed in the hope that it will be useful, *
9
+ #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10
+ #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
11
+ #* *
12
+ #***************************************************************************/
13
+
14
+ # A dialog to override configuration options.
15
+ # Whiptail is not as easily deployed here, as other dialogs.
16
+ # The main difficulty arises from the fact that positive defaults
17
+ # are negated, while a checklist wants to give positive results.
18
+
19
+ OUTFILE="$1"
20
+
21
+ # empty the file
22
+ truncate $OUTFILE -s0
23
+
24
+ TITLE="Override post-processor configuration"
25
+ CHECKTITLE="Deselect to disable. Esc or Cancel close the dialog and no changes will be applied."
26
+
27
+ # These are the configuration variables which can be unset.
28
+ VARS=(GROUP_SIGS CUSTOM_HEADERS XNAY_GROUPS VFY_URLS DEBUG_LOG)
29
+
30
+ # Checklist options
31
+ options=(GROUP_SIGS 'Signatures' ON CUSTOM_HEADERS 'Custom headers' ON XNAY_GROUPS 'X-No-Archive' ON VFY_URLS 'Correct URLs' ON DEBUG_LOG 'Log' ON)
32
+
33
+ # show dialog and store results
34
+ result=$(whiptail --title "$TITLE" --checklist "$CHECKTITLE" 13 55 5 "${options[@]}" 3>&1 1>&2 2>&3)
35
+ # which button had been pushed?
36
+ okcancel=$?
37
+
38
+ # make an array
39
+ read -ra opts <<< $result
40
+
41
+ # comment out -------->
42
+ echo "cancel/ok ? $okcancel"
43
+ echo $result
44
+ echo "${opts[@]}"
45
+ echo "${#opts[@]}"
46
+ # <--------
47
+
48
+ # Find deselected options which shall be written to the outfile.
49
+ # Looks complicated.
50
+ if [ "$okcancel" -eq 0 ]
51
+ then
52
+ list=''
53
+ # check each available variable ...
54
+ for c in ${VARS[@]}
55
+ do
56
+ deactivate=TRUE
57
+ # ... against the result from the dialog
58
+ for o in ${opts[@]}
59
+ do
60
+ if [ "$o" == "\"$c\"" ]
61
+ then
62
+ # ignore if a variable remained checked ...
63
+ deactivate=FALSE
64
+ fi
65
+ done
66
+ # ... else write it to the list.
67
+ if [ "$deactivate" == TRUE ]
68
+ then
69
+
70
+ list="$list $c"
71
+ fi
72
+ done
73
+ # Heureka.
74
+ echo "$list" > "$OUTFILE"
75
+ else
76
+ echo "exit" > "$OUTFILE"
77
+ fi
78
+
79
+ # Ω
data/lib/yad_dlg ADDED
@@ -0,0 +1,52 @@
1
+ #!/bin/bash
2
+
3
+ #/**************************************************************************
4
+ #* This program is free software; you can redistribute it and/or modify *
5
+ #* it under the terms of the WTFPL 2.0 or later, see *
6
+ #* http://www.wtfpl.net/about/ *
7
+ #* *
8
+ #* This program is distributed in the hope that it will be useful, *
9
+ #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10
+ #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
11
+ #* *
12
+ #***************************************************************************/
13
+
14
+ # A dialog to override configuration options
15
+
16
+ TITLE="Override post-processor configuration"
17
+ # These are the configuration variables which can be
18
+ # unset.
19
+ GROUP_SIGS=1
20
+ CUSTOM_HEADERS=2
21
+ XNAY_GROUPS=3
22
+ VFY_URLS=4
23
+ DEBUG_LOG=5
24
+ CONF=($(yad --item-separator=" " --title "$TITLE" --image="" --window-icon="" --form \
25
+ --field="Uncheck to disable options\n<b>Esc and Cancel</b> terminate the post-processor.":LBL ""\
26
+ --field="Signature":CHK 'true' \
27
+ --field="Custom-headers":CHK 'true' \
28
+ --field="XNAY":CHK 'true' \
29
+ --field="URL Correction":CHK 'true' \
30
+ --field="Log":CHK 'true'))
31
+
32
+ if [ $? == 0 ]
33
+ then
34
+ IFS="|"
35
+ read -ra C_ARR <<< $CONF
36
+ CONF=''
37
+ # ------------->
38
+ # echo ${C_ARR[@]}
39
+ # <-------------
40
+
41
+ for i in GROUP_SIGS CUSTOM_HEADERS XNAY_GROUPS VFY_URLS DEBUG_LOG
42
+ do
43
+ if [ 'FALSE' == "${C_ARR[$i]}" ]
44
+ then
45
+ CONF="$i $CONF"
46
+ fi
47
+ done
48
+ # signal the fields to disable (others will be ignored)
49
+ echo $CONF
50
+ else
51
+ exit 1
52
+ fi
data/lib/zenity_dlg ADDED
@@ -0,0 +1,59 @@
1
+ #!/bin/bash
2
+
3
+ #/**************************************************************************
4
+ #* This program is free software; you can redistribute it and/or modify *
5
+ #* it under the terms of the WTFPL 2.0 or later, see *
6
+ #* http://www.wtfpl.net/about/ *
7
+ #* *
8
+ #* This program is distributed in the hope that it will be useful, *
9
+ #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
10
+ #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
11
+ #* *
12
+ #***************************************************************************/
13
+
14
+ # A dialog to override configuration options
15
+
16
+ TITLE="Override post-processor configuration"
17
+ # The options are the configuration variables which can be unset.
18
+
19
+ CONF=$(zenity --title "$TITLE" --text "Deselect options to disable.\n<b>Esc and Cancel</b> terminate the post-processor."\
20
+ --height 450 --list --checklist --column 'set' --column 'Option' --column '' \
21
+ TRUE GROUP_SIGS Signature\
22
+ TRUE CUSTOM_HEADERS "Custom Headers"\
23
+ TRUE XNAY_GROUPS "X-No-Archive"\
24
+ TRUE VFY_URLS "Correct URLs"\
25
+ TRUE DEBUG_LOG Log)
26
+
27
+ if [ $? == 0 ]
28
+ then
29
+ IFS="|"
30
+ read -ra C_ARR <<< $CONF
31
+ CONF=''
32
+ # ------------->
33
+ # echo ${C_ARR[@]}
34
+ # <-------------
35
+
36
+ for c in GROUP_SIGS CUSTOM_HEADERS XNAY_GROUPS VFY_URLS DEBUG_LOG
37
+ do
38
+ # disable only the options which are missing in
39
+ # the Zenity return value
40
+ disable=1
41
+
42
+ for o in "${C_ARR[@]}"
43
+ do
44
+ if [ "$o" == "$c" ]
45
+ then
46
+ disable=
47
+ fi
48
+ done
49
+
50
+ if [ $disable ]
51
+ then
52
+ CONF="$CONF $c"
53
+ fi
54
+ done
55
+ # signal the fields to disable (others will be ignored)
56
+ echo $CONF
57
+ else
58
+ exit 1
59
+ fi
metadata ADDED
@@ -0,0 +1,88 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: flnews_post_proc
3
+ version: !ruby/object:Gem::Version
4
+ version: '1.40'
5
+ platform: ruby
6
+ authors:
7
+ - Michael Uplawski
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-04-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: diffy
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3.4'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 3.4.2
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
26
+ requirements:
27
+ - - "~>"
28
+ - !ruby/object:Gem::Version
29
+ version: '3.4'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 3.4.2
33
+ description: Post-processor for Usenet-articles created in FLNews
34
+ email: michael.uplawski@uplawski.eu
35
+ executables:
36
+ - flnews_post_proc
37
+ extensions: []
38
+ extra_rdoc_files: []
39
+ files:
40
+ - README.md
41
+ - bin/flnews_post_proc
42
+ - doc/html/flnews_post_proc.html
43
+ - doc/html/flnews_post_proc_fr.html
44
+ - doc/license.txt
45
+ - doc/man/flnews_post_proc.1.gz
46
+ - doc/man/flnews_post_proc_fr.1.gz
47
+ - doc/pdf/flnews_post_proc.pdf
48
+ - doc/pdf/flnews_post_proc_fr.pdf
49
+ - doc/rst/flnews_post_proc.rst
50
+ - doc/rst/flnews_post_proc_fr.rst
51
+ - lib/basic_logging.rb
52
+ - lib/body.rb
53
+ - lib/color_output.rb
54
+ - lib/configuration.rb
55
+ - lib/flnews_post_proc.conf
56
+ - lib/flnews_post_proc.rb
57
+ - lib/headers.rb
58
+ - lib/newsgroups.rb
59
+ - lib/override.rb
60
+ - lib/ruby_dlg
61
+ - lib/version.rb
62
+ - lib/whiptail_dlg
63
+ - lib/yad_dlg
64
+ - lib/zenity_dlg
65
+ homepage: https://rubygems.org
66
+ licenses:
67
+ - Nonstandard
68
+ metadata: {}
69
+ post_install_message:
70
+ rdoc_options: []
71
+ require_paths:
72
+ - lib
73
+ required_ruby_version: !ruby/object:Gem::Requirement
74
+ requirements:
75
+ - - ">="
76
+ - !ruby/object:Gem::Version
77
+ version: '3.0'
78
+ required_rubygems_version: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ requirements: []
84
+ rubygems_version: 3.4.20
85
+ signing_key:
86
+ specification_version: 4
87
+ summary: Moved the override-dialog scripts from the executables directory to lib
88
+ test_files: []