File: format-TODO

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

- less verbose reporting modes:
    all standard information, but no percentage counters (to include statistics)
    ability to put logging/statistics information to stdout or stderr, and percentage counters to the other
- make --text=mbox filename configurable (relative(to -p) and absolute)

- verbosity levels: (<- superceded below)
    * 0: print nothing
    * 1: print group, directory, and regexp, one per line, for every regexp in
	 the options.
    * 2: as 1, but also print one line 

- format lines: have one for each possible action along the way (mostly).  Command line or .ngetrc file. For now:
    -g, -G, -p, -P, -r, -R, -d
    * then two for every article downloaded (pre and post), two for each article decoded (pre and post), and
    * one auto-update line for interactive update information.
    * newlines are not automatic, "\n" will need to be explicit
    * each status line will use the same nested format style and replacement characters as follows:
    %[<loc>][&<pad>][!][<width>][.<num> ...]<repcode>[{<subformat>[:s/<pat>/<subs>/<flags> ...]}]
    ie: "%p" might substitute the path, "%<-20r" might left-justify the regex used in a field of 20 characters,
	chopping extra characters if the width is exceeded.

	(some codes, such as header size, will not apply to every format line)
	%p	current d/l path
	%P	current temp path
	%r	current regex or expression
	%g	current groupalias
	%G	current groupname
	%d	download flags set
	%T	whether testmode is set
	%t	current time
	%i	number of bytes downloaded for this regexp/expression so far
	%I	total expected for this -r/-R
	%j	# bytes so far for this path
	%J	total expected for this -p
	%k	total number of bytes downloaded this session
	%K	expected total number of bytes to download
	%%	literal "%" character, unless <pad> is specified, in which case <fieldwidth> of those are inserted.

	(per-article codes)
	%B	size of article in bytes
	%l	number of lines in article
	%a	author
	%s	subject
	%n	part number
	%N	maximum part number
	%D	date and time
	%z	article number
	%h{<header>}	the specified header (ie, from, subject, etc.)
	
	(interactive and post-download codes) - includes per-article codes
	%R	download rate
	%b	number of bytes downloaded
	%e	time elapsed
	%E	estimated (total) time until completion (ie, # of seconds)
	%x	transfer start time
	%X	estimated (actual) time of completion

	location codes:
	<	left justify
	|	center justify
	=	outer justify (if the code specifies a field with 2 segments, segments are split
	>	right justify

	chop code:
	-	truncates line on the right if it is too long for the fieldwidth.
		Preserves column integrity.  without it, no truncation will occur.
		
    Or the system could be implemented with a heirarchy of specifiers.
    
    %[<loc>][&<pad>][!][<width>][.<num> ...]<repcode>[{<subformat>[:s/<pat>/<subs>/<flags> ...]}]
    ie: "%p" might substitute the path, "%<-20r" might left-justify the regex used in a field of 20 characters,
	chopping extra characters if the width is exceeded.

	Top hierarchy letter codes:
	p[cdt]	paths: c.urrent, d.ownload, t.emp
	R		current regexp or expression
	g		groupaliases
	G		group spec (dotted)
	c.Tif? :	conditional: T.est code enabled, i.n midfile do check, f.ile exists do check
	s[<unit>].-=afrptsl	file/stream/string size (in unit blocks: characters, Kb, etc.)
	r[<unit>[/<timeunit>]].afrptsl	transfer (d/l) rate (uc: average, lc: current snapshot)
	l[<unit>].afrptsl	lines so far (lowercase) or total expected (uppercase) for s type sub specifiers
	n.pP		number: current p.art, total P.arts
	d.ca		date/time specification: c.urrent, a.article
	t.afrptsl	time duration: same sub-specs as for s
	h.aispdAISPD	header shortcut extractors (uppercase: entire line, lower: header word + ":" excluded):
			a.uthor, article i.d, s.ubject, p.ath, d.ate of post, etc...
	{}		header line extraction code
	//		header match extraction code (any match from within header will trigger inclusion)
	
	<track> is a trackable unit, separated with . for current, = for total, and - for remaining
	    a.rticle
	    f.ile
	    r.egexp same downloaded files combined
	    p.ath same
	    t.emp path same
	    s.ession same
	    l.og same

	<unit> is one of:
	    unspecified (sized to fit field width, but will append abbrev.  unit as specified below)
	    b:	bits
	    B:	bytes
	    k:  1000 bytes
	    K:  kilobytes (1024)
	    m:  10^6
	    M:  2^20 (mega)
	    g:  10^9
	    G:	2^30 (giga)
	    t:	10^12
	    T:	2^40 (tera)
	    
	(some codes, such as header size, will not apply to every format spec)
	%p.c	current base path (where nget was initiated from)
	%p.d	current d/l path
	%p.t	current temp path
	%R	current regex or expression
	%g	current groupalias
	%G	current groupname
	%c.T?<setformat>:<elsformat>	whether testmode is set
	%c.f?:	download flag f set
	%c.i?:	download flag i set
	%d.c	current date/time
	%d.u	date of current group update
	%s.r	total number of bytes downloaded for this regexp/expression so far
	%s.R	total expected for this -r/-R
	%s.p	# bytes so far for this path
	%s.P	total expected for this -p
	%s.s	total number of bytes downloaded this session
	%s.S	expected total number of bytes to download
	%%	literal "%" character, unless <pad> is specified, in which case <fieldwidth> of those are inserted.

	(per-article codes)
	%s.A	(expected) size of article in bytes
	%l.A	(expected) number of lines in article
	%h.a	author
	%h.s	subject
	%h.i	message id
	%h.p	post path
	%{<header>}	the specified header (ie, from, subject, etc.)
	%n.p	part number
	%n.P	maximum part number
	%n.o	[x/X] part display (part x of X total)
	%n.a	article number
	%d.p	date and time of article postage
	
	(interactive and post-download codes) - includes per-article codes
	%r.t	(pseudo-)current transfer rate
	%r.T	average transfer rate
	%s.a	total number of bytes downloaded so far
	%l.a	number of lines downloaded so far
	%t.a	time elapsed
	%t.A	estimated (total) time until completion (ie, # of seconds)
	%d.p	transfer start time
	%d.P	estimated (actual) time of completion

	location codes:
	<	left justify
	|	center justify
	=	outer justify (if the code specifies a field with 2 segments, segments are split
	>	right justify

	chop codes:
	-	truncates line on the right if it is too long for the fieldwidth.
		Preserves column integrity.  without it, no truncation will occur.
		On two segment fields, truncates at division
	*	chops an extra character to insert a * to show truncation.
	.	chops 3 extra characters to insert a ... if to long.
	+	inserts width worth of + if line to long, fortran style.  Not recommended