def _cache_valid(report_file, cache_file, script_modified=__last_save): """ @param report_file: the file to check cache for @type report_file: str @param cache_file: the cached data file corresponding to the report file @type cache_file: str @param script_modified: time after which cache is considered outdated @type script_modified: float @return: bool @rtype: bool """ report_modified = _os_stat(report_file).st_mtime cache_modified = _os_stat(cache_file).st_mtime return cache_modified > report_modified and cache_modified > script_modified
Edit this function to do all profiling. """ import cProfile from pstats import Stats profile_file = "C:\\Users\\PBS Biotech\\Documents\\Personal\\PBS_Office\\MSOffice\\officelib\\pbslib\\test\\profile.txt" cProfile.run('full_scan(manyfile3, manyrecipesteps)', filename=profile_file) with open("C:\\Users\\Public\\Documents\\PBSSS\\Functional Testing\\tpid.txt", 'w') as f: stats = Stats(profile_file, stream=f) # stats.strip_dirs() stats.sort_stats('time') stats.print_stats('MSOffice') from os import stat as _os_stat __last_save = _os_stat(__file__).st_mtime def _cache_valid(report_file, cache_file, script_modified=__last_save): """ @param report_file: the file to check cache for @type report_file: str @param cache_file: the cached data file corresponding to the report file @type cache_file: str @param script_modified: time after which cache is considered outdated @type script_modified: float @return: bool @rtype: bool """ report_modified = _os_stat(report_file).st_mtime