##// END OF EJS Templates
py3: use raw strings in statprof.py...
Gregory Szorc -
r40235:b594db74 default
parent child Browse files
Show More
@@ -902,17 +902,17 b' def main(argv=None):'
902
902
903 optstart = 2
903 optstart = 2
904 displayargs['function'] = None
904 displayargs['function'] = None
905 if argv[1] == 'hotpath':
905 if argv[1] == r'hotpath':
906 displayargs['format'] = DisplayFormats.Hotpath
906 displayargs['format'] = DisplayFormats.Hotpath
907 elif argv[1] == 'lines':
907 elif argv[1] == r'lines':
908 displayargs['format'] = DisplayFormats.ByLine
908 displayargs['format'] = DisplayFormats.ByLine
909 elif argv[1] == 'functions':
909 elif argv[1] == r'functions':
910 displayargs['format'] = DisplayFormats.ByMethod
910 displayargs['format'] = DisplayFormats.ByMethod
911 elif argv[1] == 'function':
911 elif argv[1] == r'function':
912 displayargs['format'] = DisplayFormats.AboutMethod
912 displayargs['format'] = DisplayFormats.AboutMethod
913 displayargs['function'] = argv[2]
913 displayargs['function'] = argv[2]
914 optstart = 3
914 optstart = 3
915 elif argv[1] == 'flame':
915 elif argv[1] == r'flame':
916 displayargs['format'] = DisplayFormats.FlameGraph
916 displayargs['format'] = DisplayFormats.FlameGraph
917 else:
917 else:
918 printusage()
918 printusage()
@@ -930,22 +930,22 b' def main(argv=None):'
930 displayargs['limit'] = 0.05
930 displayargs['limit'] = 0.05
931 path = None
931 path = None
932 for o, value in opts:
932 for o, value in opts:
933 if o in ("-l", "--limit"):
933 if o in (r"-l", r"--limit"):
934 displayargs['limit'] = float(value)
934 displayargs['limit'] = float(value)
935 elif o in ("-f", "--file"):
935 elif o in (r"-f", r"--file"):
936 path = value
936 path = value
937 elif o in ("-o", "--output-file"):
937 elif o in (r"-o", r"--output-file"):
938 displayargs['outputfile'] = value
938 displayargs['outputfile'] = value
939 elif o in ("-p", "--script-path"):
939 elif o in (r"-p", r"--script-path"):
940 displayargs['scriptpath'] = value
940 displayargs['scriptpath'] = value
941 elif o in ("-h", "help"):
941 elif o in (r"-h", r"help"):
942 printusage()
942 printusage()
943 return 0
943 return 0
944 else:
944 else:
945 assert False, "unhandled option %s" % o
945 assert False, "unhandled option %s" % o
946
946
947 if not path:
947 if not path:
948 print('must specify --file to load')
948 print(r'must specify --file to load')
949 return 1
949 return 1
950
950
951 load_data(path=path)
951 load_data(path=path)
@@ -954,5 +954,5 b' def main(argv=None):'
954
954
955 return 0
955 return 0
956
956
957 if __name__ == "__main__":
957 if __name__ == r"__main__":
958 sys.exit(main())
958 sys.exit(main())
General Comments 0
You need to be logged in to leave comments. Login now