Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

added view() for debugging purposes #3

Merged
merged 1 commit into from

2 participants

@kamired22

No description provided.

@mattseh mattseh merged commit c0b0217 into mattseh:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 19, 2012
  1. @kamired22
This page is out of date. Refresh to see the latest.
Showing with 11 additions and 1 deletion.
  1. +11 −1 web.py
View
12 web.py
@@ -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
@@ -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):
Something went wrong with that request. Please try again.