source: SHX/trunk/SeismicHandler/commands/del.py @ 532

Revision 532, 1.5 KB checked in by marcus, 11 years ago (diff)
  • implemented DEL command
  • Property svn:eol-style set to native
Line 
1# -*- coding: utf-8 -*-
2
3#    This file is part of Seismic Handler eXtended (SHX).
4#
5#    SHX is free software: you can redistribute it and/or modify
6#    it under the terms of the GNU Lesser General Public License as published
7#    by the Free Software Foundation, either version 3 of the License, or
8#    (at your option) any later version.
9#
10#    SHX is distributed in the hope that it will be useful,
11#    but WITHOUT ANY WARRANTY; without even the implied warranty of
12#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#    GNU Lesser General Public License for more details.
14#
15#    You should have received a copy of the GNU Lesser General Public License
16#    along with SHX.  If not, see <http://www.gnu.org/licenses/>.
17
18from SeismicHandler.basics.command import BaseCommand
19from SeismicHandler.basics.tools import expandTraceList
20from SeismicHandler.core import Traces
21from SeismicHandler.modules.traces import Traces as BaseTraces
22
23provides = {"del": "_del"}
24class _del(BaseCommand):
25    """
26    URI:http://www.seismic-handler.org/portal/wiki/ShDel
27    """
28    numberOfParameters = [1,]
29    known_qualifiers = [
30    ]
31    expectFilename = False
32
33    def __init__(self, *args, **kwargs):
34        # unroll args & kwargs
35        BaseCommand.__init__(self, *args, **kwargs)
36
37    def run(self):
38        lst = expandTraceList(Traces, self.parameters[0])
39       
40        for i in lst:
41            Traces.pop(i)
42
43        t = BaseTraces()
44        t.updateCounter()
45
46
47if __name__ == "__main__":
48    import doctest
49    doctest.testmod(exclude_empty=True)
Note: See TracBrowser for help on using the repository browser.