Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: third_party/logilab/common/dbf.py

Issue 719313003: Revert "pylint: upgrade to 1.3.1" (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/logilab/common/date.py ('k') | third_party/logilab/common/debugger.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. 2 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr 3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
4 # 4 #
5 # This file is part of logilab-common. 5 # This file is part of logilab-common.
6 # 6 #
7 # logilab-common is free software: you can redistribute it and/or modify it unde r 7 # logilab-common is free software: you can redistribute it and/or modify it unde r
8 # the terms of the GNU Lesser General Public License as published by the Free 8 # the terms of the GNU Lesser General Public License as published by the Free
9 # Software Foundation, either version 2.1 of the License, or (at your option) an y 9 # Software Foundation, either version 2.1 of the License, or (at your option) an y
10 # later version. 10 # later version.
(...skipping 18 matching lines...) Expand all
29 29
30 http://www.physics.ox.ac.uk/users/santoso/Software.Repository.html 30 http://www.physics.ox.ac.uk/users/santoso/Software.Repository.html
31 page says code is "available as is without any warranty or support". 31 page says code is "available as is without any warranty or support".
32 """ 32 """
33 33
34 import struct 34 import struct
35 import os, os.path 35 import os, os.path
36 import sys 36 import sys
37 import csv 37 import csv
38 import tempfile 38 import tempfile
39 39 import ConfigParser
40 from six.moves import range
41 40
42 class Dbase: 41 class Dbase:
43 def __init__(self): 42 def __init__(self):
44 self.fdb = None 43 self.fdb = None
45 self.fmemo = None 44 self.fmemo = None
46 self.db_data = None 45 self.db_data = None
47 self.memo_data = None 46 self.memo_data = None
48 self.fields = None 47 self.fields = None
49 self.num_records = 0 48 self.num_records = 0
50 self.header = None 49 self.header = None
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 for i in range(0, num): 220 for i in range(0, num):
222 record = db.get_record_with_names(i) 221 record = db.get_record_with_names(i)
223 rec.append(record) 222 rec.append(record)
224 db.close() 223 db.close()
225 return rec 224 return rec
226 225
227 if __name__=='__main__': 226 if __name__=='__main__':
228 rec = readDbf('dbf/sptable.dbf') 227 rec = readDbf('dbf/sptable.dbf')
229 for line in rec: 228 for line in rec:
230 print '%s %s' % (line['GENUS'].strip(), line['SPECIES'].strip()) 229 print '%s %s' % (line['GENUS'].strip(), line['SPECIES'].strip())
OLDNEW
« no previous file with comments | « third_party/logilab/common/date.py ('k') | third_party/logilab/common/debugger.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698