~jtv/corpusfiltergraph/cross-python

« back to all changes in this revision

Viewing changes to trunk/lib/corpusfg/plugins/null-copyfile.py

  • Committer: tahoar
  • Date: 2012-05-02 15:46:23 UTC
  • Revision ID: svn-v4:bc069b21-dff4-4e29-a776-06a4e04bad4e::266
new layout. need to update code to use the new layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /usr/bin/env python
 
2
# -*- coding: utf8 -*-
 
3
 
 
4
#===============================================================================
 
5
# Author: Tom Hoar
 
6
#===============================================================================
 
7
 
 
8
#version:
 
9
#4.0.264 - version update
 
10
 
 
11
import os
 
12
 
 
13
import common as cf
 
14
 
 
15
class filter(object):
 
16
 
 
17
        cfg = {
 
18
                'version' : '4.0.264',
 
19
                }
 
20
        isopen = False
 
21
        p = object
 
22
        errors = []
 
23
 
 
24
        def open(self,parent,cfg):
 
25
                return
 
26
 
 
27
        def run(self,k):
 
28
                '''run filter'''
 
29
                try:
 
30
                        os.rename(self.p.cfinput[k]['tempname'], self.p.cfoutput[k]['tempname'])
 
31
                except:
 
32
                        return -2
 
33
 
 
34
        def flush(self,k):
 
35
                return
 
36
 
 
37
        def close(self):
 
38
                return
 
39
 
 
40
def usage():
 
41
        '''Command prompt help.'''
 
42
        return "\n%s\n\tUsage:\n\tfrom %s import filter\n"%(
 
43
        os.path.basename(sys.argv[0]),
 
44
        os.path.splitext(os.path.basename(sys.argv[0]))[0]
 
45
        )
 
46
 
 
47
licensetxt=u'''CorpusFiltergraph™ v4.0
 
48
Copyright © 2010-2012 Precision Translation Tools Co., Ltd.
 
49
 
 
50
This program is free software: you can redistribute it and/or modify
 
51
it under the terms of the GNU Lesser General Public License as published by
 
52
the Free Software Foundation, either version 3 of the License, or
 
53
(at your option) any later version.
 
54
 
 
55
This program is distributed in the hope that it will be useful,
 
56
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
57
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
58
GNU Lesser General Public License for more details.
 
59
 
 
60
You should have received a copy of the GNU Lesser General Public License
 
61
along with this program.  If not, see http://www.gnu.org/licenses/.
 
62
 
 
63
For more information, please contact Precision Translation Tools Co., Ltd.
 
64
at: http://www.precisiontranslationtools.com'''
 
65
 
 
66
if __name__ == "__main__":
 
67
        import os
 
68
        import sys
 
69
        sys.stdout.write(usage().encode('utf8')+'\n')