Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added view() for debugging purposes #3

Merged
merged 1 commit into from
Mar 21, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion web.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import pybloom
import json
import csv
import os.path
import os
import multiprocessing
import httplib
import copy
import inspect
import Queue
import tempfile
import subprocess

import greenlet
import gevent
Expand Down Expand Up @@ -348,6 +350,14 @@ def hidden_fields(self):
for name, value in self.xpath('//input[@type="hidden"]/@name||//input[@type="hidden"]/@value'):
fields[name] = value
return fields

def view(self):
p = tempfile.mktemp() + '.html'
self.save(p)
if os.name == 'mac': subprocess.call(('open', p))
elif os.name == 'nt': os.startfile(p)
elif os.name == 'posix': subprocess.call(('xdg-open', p))



class ProxyManager(object):
Expand Down