def snap(self, path=None):
if path is None:<EOL><INDENT>path = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>path = path.rstrip("<STR_LIT:/>")<EOL><DEDENT>day_dir = datetime.datetime.now().strftime("<STR_LIT>")<EOL>hour_dir = datetime.datetime.now().strftime("<STR_LIT>")<EOL>ensure_snapshot_dir(path+"<STR_LIT:/>"+self.cam_id+"<STR_LIT:/>"+day_dir+"<STR_LIT:/>"+hour_dir)<EOL>f_path = "<STR_LIT>".format(<EOL>path,<EOL>self.cam_id,<EOL>day_dir,<EOL>hour_dir,<EOL>datetime.datetime.now().strftime("<STR_LIT>"),<EOL>)<EOL>urllib.urlretrieve(<EOL>'<STR_LIT>'.format(<EOL>self.address, <EOL>self.user, <EOL>self.pswd,<EOL>),<EOL>f_path,<EOL>)<EOL>
Get a snapshot and save it to disk.