Skip to content

Commit

Permalink
Fix get_about_memory.py so it runs fix_b2g_stack.py on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlebar committed Dec 20, 2012
1 parent 945fff6 commit 2b24a29
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions tools/get_about_memory.py
Expand Up @@ -179,6 +179,8 @@ def get_and_show_dump(args):

# Try to open the dump in Firefox.
about_memory_url = "about:memory?file=%s" % urllib.quote(merged_reports_path)

opened_in_firefox = False
if args.open_in_firefox:
try:
# Open about_memory_url in Firefox, but don't display stdout or stderr.
Expand All @@ -193,23 +195,24 @@ def get_and_show_dump(args):
# platform-independent, so whatever.
fnull = open('/dev/null', 'w')
subprocess.Popen(['firefox', about_memory_url], stdout=fnull, stderr=fnull)
opened_in_firefox = True

print()
print(textwrap.fill(textwrap.dedent('''\
I just tried to open the memory report in Firefox. If that
didn't work for some reason, or if you want to open this report
at a later time, open the following URL in a Firefox nightly build:
''')) + '\n\n ' + about_memory_url)
return
except (subprocess.CalledProcessError, OSError):
pass

# If not args.open_in_firefox or if we weren't able to open in Firefox,
# output the message below.
print()
print(textwrap.fill(textwrap.dedent('''\
To view this report, open Firefox on this machine and load the
following URL:
''')) + '\n\n ' + about_memory_url)
# If we didn't open in Firefox, output the message below.
if not opened_in_firefox:
print()
print(textwrap.fill(textwrap.dedent('''\
To view this report, open Firefox on this machine and load the
following URL:
''')) + '\n\n ' + about_memory_url)

process_dmd_files(dmd_files, args)

Expand Down

0 comments on commit 2b24a29

Please sign in to comment.