Skip to content

Commit

Permalink
added view() for debugging purposes
Browse files Browse the repository at this point in the history
  • Loading branch information
kamired22 committed Mar 19, 2012
1 parent 19614ea commit 7cad833
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion web.py
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

0 comments on commit 7cad833

Please sign in to comment.