<s> """<STR_LIT>""" <EOL> import sys <EOL> FILE = "<STR_LIT>" <EOL> class Mount ( object ) : <EOL> def __init__ ( self ) : <EOL> self . device = None <EOL> self . mountpoint = None <EOL> self . fstype = None <EOL> self . options = None <EOL> self . freq = <NUM_LIT:0> <EOL> self . passno = <NUM_LIT:0> <EOL> def parse ( self , line ) : <EOL> [ self . device , self . mountpoint , self . fstype , self . options , self . freq , self . passno ] = line . split ( ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . device , self . mountpoint , self . fstype , self . options , self . freq , self . passno ) <EOL> class Mounts ( dict ) : <EOL> def update ( self ) : <EOL> self . clear ( ) <EOL> fo = open ( FILE ) <EOL> for line in fo : <EOL> mo = Mount ( ) <EOL> mo . parse ( line ) <EOL> self [ mo . mountpoint ] = mo <EOL> fo . close ( ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT:\n>" . join ( map ( str , self . values ( ) ) ) <EOL> def get_mounts ( ) : <EOL> mounts = Mounts ( ) <EOL> mounts . update ( ) <EOL> return mounts <EOL> if __debug__ : <EOL> def _test ( argv ) : <EOL> mnts = get_mounts ( ) <EOL> print mnts <EOL> print <EOL> print mnts [ "<STR_LIT:/>" ] . fstype <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> _test ( sys . argv ) </s>
