Package: eyed3 / 0.8.8-1

remove-display-plugin Patch series | download
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
Remove plugin display.

The plugin has a dependency, glako, currently not packaged in Debian.

--- a/src/eyed3/plugins/DisplayPattern.ebnf
+++ /dev/null
@@ -1,31 +0,0 @@
-(*
-################################################################################
-#  Copyright (C) 2016  Sebastian Patschorke <physicspatschi@gmx.de>
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-################################################################################
-
-parser generation:
-$ python -m grako -o src/eyed3/plugins/display_parser.py src/eyed3/plugins/DisplayPattern.ebnf
-
-*)
-
-start               = pattern $ ;
-pattern             = { text | tag | function }* ;
-tag                 = tag:( "%" name:string { "," parameters+:(parameter) }* "%" );
-function            = function:("$" name:string "(" [ parameters+:(parameter) { "," parameters+:(parameter) }* ]  ")" );
-parameter           = [ {" "}* name:string "=" ] [ value:pattern ] ;
-text                = text:?/(\\\\|\\%|\\\$|\\,|\\\(|\\\)|\\=|\\n|\\t|[^\\%$,()])+/? ;
-string              = ?/([^\\%$,()=])+/? ;
--- a/src/eyed3/plugins/_display_parser.py
+++ /dev/null
@@ -1,228 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-
-# CAVEAT UTILITOR
-#
-# This file was automatically generated by Grako.
-#
-#    https://pypi.python.org/pypi/grako/
-#
-# Any changes you make to it will be overwritten the next time
-# the file is generated.
-
-
-from __future__ import (print_function, division, absolute_import,
-                        unicode_literals)
-
-from grako.parsing import graken, Parser
-from grako.util import re, RE_FLAGS  # noqa
-
-
-__version__ = (2016, 2, 17, 20, 35, 22, 2)
-
-__all__ = [
-    'DisplayPatternParser',
-    'DisplayPatternSemantics',
-    'main'
-]
-
-
-class DisplayPatternParser(Parser):
-    def __init__(self,
-                 whitespace=None,
-                 nameguard=None,
-                 comments_re=None,
-                 eol_comments_re=None,
-                 ignorecase=None,
-                 left_recursion=True,
-                 **kwargs):
-        super(DisplayPatternParser, self).__init__(
-            whitespace=whitespace,
-            nameguard=nameguard,
-            comments_re=comments_re,
-            eol_comments_re=eol_comments_re,
-            ignorecase=ignorecase,
-            left_recursion=left_recursion,
-            **kwargs
-        )
-
-    @graken()
-    def _start_(self):
-        self._pattern_()
-        self._check_eof()
-
-    @graken()
-    def _pattern_(self):
-
-        def block0():
-            with self._choice():
-                with self._option():
-                    self._text_()
-                with self._option():
-                    self._tag_()
-                with self._option():
-                    self._function_()
-                self._error('no available options')
-        self._closure(block0)
-
-    @graken()
-    def _tag_(self):
-        with self._group():
-            self._token('%')
-            self._string_()
-            self.ast['name'] = self.last_node
-
-            def block2():
-                self._token(',')
-                with self._group():
-                    self._parameter_()
-                self.ast.setlist('parameters', self.last_node)
-            self._closure(block2)
-            self._token('%')
-        self.ast['tag'] = self.last_node
-
-        self.ast._define(
-            ['tag', 'name'],
-            ['parameters']
-        )
-
-    @graken()
-    def _function_(self):
-        with self._group():
-            self._token('$')
-            self._string_()
-            self.ast['name'] = self.last_node
-            self._token('(')
-            with self._optional():
-                with self._group():
-                    self._parameter_()
-                self.ast.setlist('parameters', self.last_node)
-
-                def block3():
-                    self._token(',')
-                    with self._group():
-                        self._parameter_()
-                    self.ast.setlist('parameters', self.last_node)
-                self._closure(block3)
-            self._token(')')
-        self.ast['function'] = self.last_node
-
-        self.ast._define(
-            ['function', 'name'],
-            ['parameters']
-        )
-
-    @graken()
-    def _parameter_(self):
-        with self._optional():
-
-            def block0():
-                self._token(' ')
-            self._closure(block0)
-            self._string_()
-            self.ast['name'] = self.last_node
-            self._token('=')
-        with self._optional():
-            self._pattern_()
-            self.ast['value'] = self.last_node
-
-        self.ast._define(
-            ['name', 'value'],
-            []
-        )
-
-    @graken()
-    def _text_(self):
-        self._pattern(r'(\\\\|\\%|\\\$|\\,|\\\(|\\\)|\\=|\\n|\\t|[^\\%$,()])+')
-        self.ast['text'] = self.last_node
-
-        self.ast._define(
-            ['text'],
-            []
-        )
-
-    @graken()
-    def _string_(self):
-        self._pattern(r'([^\\%$,()=])+')
-
-
-class DisplayPatternSemantics(object):
-    def start(self, ast):
-        return ast
-
-    def pattern(self, ast):
-        return ast
-
-    def tag(self, ast):
-        return ast
-
-    def function(self, ast):
-        return ast
-
-    def parameter(self, ast):
-        return ast
-
-    def text(self, ast):
-        return ast
-
-    def string(self, ast):
-        return ast
-
-
-def main(filename, startrule, trace=False, whitespace=None, nameguard=None):
-    import json
-    with open(filename) as f:
-        text = f.read()
-    parser = DisplayPatternParser(parseinfo=False)
-    ast = parser.parse(
-        text,
-        startrule,
-        filename=filename,
-        trace=trace,
-        whitespace=whitespace,
-        nameguard=nameguard)
-    print('AST:')
-    print(ast)
-    print()
-    print('JSON:')
-    print(json.dumps(ast, indent=2))
-    print()
-
-
-if __name__ == '__main__':
-    import argparse
-    import string
-    import sys
-
-    class ListRules(argparse.Action):
-        def __call__(self, parser, namespace, values, option_string):
-            print('Rules:')
-            for r in DisplayPatternParser.rule_list():
-                print(r)
-            print()
-            sys.exit(0)
-
-    parser = argparse.ArgumentParser(
-                        description="Simple parser for DisplayPattern.")
-    parser.add_argument('-l', '--list', action=ListRules, nargs=0,
-                        help="list all rules and exit")
-    parser.add_argument('-n', '--no-nameguard', action='store_true',
-                        dest='no_nameguard',
-                        help="disable the 'nameguard' feature")
-    parser.add_argument('-t', '--trace', action='store_true',
-                        help="output trace information")
-    parser.add_argument('-w', '--whitespace', type=str,
-                        default=string.whitespace,
-                        help="whitespace specification")
-    parser.add_argument('file', metavar="FILE", help="the input file to parse")
-    parser.add_argument('startrule', metavar="STARTRULE",
-                        help="the start rule for parsing")
-    args = parser.parse_args()
-
-    main(
-        args.file,
-        args.startrule,
-        trace=args.trace,
-        whitespace=args.whitespace,
-        nameguard=not args.no_nameguard
-    )