-
Notifications
You must be signed in to change notification settings - Fork 18
/
contributions.mbox
109 lines (90 loc) · 3.32 KB
/
contributions.mbox
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
From [email protected] Fri Sep 19 18:51:00 2008
Return-Path: <[email protected]>
Date: Sat, 20 Sep 2008 00:51:17 +0200
From: KELEMEN Peter <[email protected]>
To: Brett Smith <[email protected]>
Subject: [PATCH] dtrx: RAR support
Message-ID: <20080919225117.GA993@kaylee>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Status: RO
X-Status: A
Content-Length: 1589
Lines: 48
Brett,
The following patch adds RAR support for dtrx.
HTH,
Peter
diff -r ececf7836546 scripts/dtrx
--- a/scripts/dtrx Tue Sep 16 21:51:59 2008 -0400
+++ b/scripts/dtrx Sat Sep 20 00:50:16 2008 +0200
@@ -515,6 +515,25 @@ class ShieldExtractor(NoPipeExtractor):
return result
+class RarExtractor(NoPipeExtractor):
+ file_type = 'RAR archive'
+ extract_command = ['unrar', 'x']
+ list_command = ['unrar', 'l']
+ border_re = re.compile('^-+$')
+
+ def get_filenames(self):
+ inside = False
+ for line in NoPipeExtractor.get_filenames(self):
+ if self.border_re.match(line):
+ if inside:
+ break
+ else:
+ inside = True
+ elif inside:
+ yield line.split(' ')[1]
+ self.archive.close()
+
+
class BaseHandler(object):
def __init__(self, extractor, options):
self.extractor = extractor
@@ -775,6 +794,10 @@ class ExtractorBuilder(object):
'mimetypes': ('x-cab',),
'extensions': ('cab',),
'magic': ('Microsoft Cabinet Archive',)},
+ 'rar': {'extractor': RarExtractor,
+ 'mimetypes': ('rar',),
+ 'extensions': ('rar'),
+ 'magic': ('RAR archive')},
'shield': {'extractor': ShieldExtractor,
'mimetypes': ('x-cab',),
'extensions': ('cab', 'hdr'),
From [email protected] Wed Sep 24 09:42:18 2008
X-Original-To: [email protected]
Date: Wed, 24 Sep 2008 15:31:18 +0200
From: KELEMEN Peter <[email protected]>
To: Brett Smith <[email protected]>
Subject: Re: [PATCH] dtrx: RAR support
Message-ID: <20080924133118.GG8943@kyra>
References: <20080919225117.GA993@kaylee> <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <[email protected]>
User-Agent: Mutt/1.5.17+20080114 (2008-01-14)
Status: RO
Content-Length: 684
Lines: 25
* Brett Smith ([email protected]) [20080921 14:05]:
> Thanks very much for this; it looks great.
You're welcome.
> Can you please confirm for me that it's licensed under GPLv3 or
> any later version? A simple "yes" will do. :)
Sure, GPLv3 is OK.
> Also, do you want me to add any copyright notice(s) for your
> contribution?
I'm ambivalent, I trust your judgement. Should you choose to do
so, please use my [email protected] address.
Thanks,
Peter
--
.+'''+. .+'''+. .+'''+. .+'''+. .+''
Kelemen Péter / \ / \ [email protected]
.+' `+...+' `+...+' `+...+' `+...+'