Changeset 4952


Ignore:
Timestamp:
Jan 17, 2008, 7:00:27 PM (17 years ago)
Author:
ole
Message:

Work on IP tracking

Location:
anuga_core/source/anuga/utilities
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/utilities/data_audit.py

    r4944 r4952  
    176176
    177177        if node.nodeName == 'svn_keywords':
    178             # Do something
     178            # Do nothing
    179179            pass
    180180       
     
    213213                else:
    214214                    print 'Data file %s is flagged publishable' %fid.name               
    215        
     215
     216    #FIXME (Ole): Use hash code for original datafile as an XML element
     217    # USE CRC32 in zlib or hash
    216218   
    217219    #for node in elements:
  • anuga_core/source/anuga/utilities/system_tools.py

    r4787 r4952  
    171171            print 'Version info stored to %s' %filename
    172172           
     173
     174def compute_checksum(filename):
     175    """Compute the CRC32 checksum for specified file
     176    """
     177
     178    import zlib
     179    #FIXME(Ole): Do we need to limit the size?
     180
     181    fid = open(filename)
     182
     183    crcval = zlib.crc32(fid.read())
     184   
     185    return crcval
  • anuga_core/source/anuga/utilities/test_system_tools.py

    r3937 r4952  
    2525        # print host
    2626        assert isinstance(host, basestring), 'User name should be a string'       
     27    def test_compute_checksum(self):
     28        """test_compute_checksum(self):
     29
     30        Check that checksums on files are OK
     31        """
     32        # FIXME: Not Done Yet
     33
     34        from temp import mkstemp
     35
     36        # Generate a text file
     37        fd, pathname = mkstemp(['.tmp', '', '.', ''])
     38
    2739       
     40       
     41
    2842       
    2943#-------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.