Skip to content

Bewest/fix form view url#4

Open
bewest wants to merge 2 commits into
jpf:masterfrom
bewest:bewest/fix-form-view-url
Open

Bewest/fix form view url#4
bewest wants to merge 2 commits into
jpf:masterfrom
bewest:bewest/fix-form-view-url

Conversation

@bewest

@bewest bewest commented Mar 21, 2014

Copy link
Copy Markdown

Based on the information I have available on hand, this should help fix #3 (comment)

I've tested in locally on my console to make sure some data gets generated, and running the app.py locally says that it works:

image

bewest added 2 commits March 20, 2014 17:02
Based on jpf#3 (comment)
This should allow the newer google URLs to work.
Simplify the html scraping a bit
This appears to do the right thing:

https://docs.google.com/forms/d/1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw/viewform
```python
>>> reload(gform)
<module 'gform' from 'gform.pyc'>
>>> s
'https://docs.google.com/forms/d/1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw/viewform'
>>> k
'1TLHCRZWsLt7huSzqlLoqA0MIHYT9n5xZRo4bRSotvlw'
>>>
>>> G = gform.GForm(k, s)
>>> G.show_state( )
Parameters: {'entry.323738588': '', 'entry.1914238709': '', 'submit': 'Submit', 'entry.471541577': ''}
Labels: {'To': 'entry.1914238709', 'SmsSid': 'entry.323738588', 'From': 'entry.471541577'}
>>>

```

Without this patch I get the following errors:

```python
>>> reload(gform)
<module 'gform' from 'gform.py'>
>>> G = gform.GForm(k, s)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "gform.py", line 48, in __init__
    input_label = elements[0].text.rstrip()
AttributeError: 'NoneType' object has no attribute 'rstrip'
>>>

```
@jpf

jpf commented Mar 30, 2014

Copy link
Copy Markdown
Owner

Thanks for this pull request Ben, I really appreciate it.

I'll have to take a look at this in more depth before I merge in your changes, in particular, I want to make sure that existing setups of TwilioSheet will not be impacted. Also, a bunch of my tests are failing, so I'll need to figure out what that means.

This is just the shove I needed to get this all fixed, thanks for sending this along.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Live form URL not working

2 participants