Mercurial > repos > iuc > datatyp_json
comparison json.py @ 1:a37d92dc7fd2 draft
Uploaded
author | iuc |
---|---|
date | Mon, 28 Jul 2014 03:38:39 -0400 |
parents | 3b76639ad0bb |
children |
comparison
equal
deleted
inserted
replaced
0:3b76639ad0bb | 1:a37d92dc7fd2 |
---|---|
19 def sniff( self, filename ): | 19 def sniff( self, filename ): |
20 """ | 20 """ |
21 Try to load the string with the json module. If successful it's a json file. | 21 Try to load the string with the json module. If successful it's a json file. |
22 """ | 22 """ |
23 try: | 23 try: |
24 json.load( filename ) | 24 json.load( open(filename) ) |
25 return True | 25 return True |
26 except: | 26 except: |
27 return False | 27 return True |
28 | 28 |
29 def set_meta( self, dataset, **kwd ): | 29 def set_meta( self, dataset, **kwd ): |
30 """ | 30 """ |
31 | 31 |
32 Set the number of models in dataset. | 32 Set the number of models in dataset. |