solved....

On Thursday, November 29, 2012 1:10:35 AM UTC+3, apps in tables wrote:
>
> Hi,
>
> can someone help me find the missing "pass" .
>
>
>
> {{extend 'layout.html'}}
>
> <div class="row ">
>   <h3 class="btn btn-large btn-block btn-danger  span4 offset4">  ((( 
> الحــــالة  ))) </h3>
> </div>
>
> <div class="well center">
>
>   <br/>
>   <br/>
>   {{=kase.on_date}}
>   <br/>
>   <br/>
>   {{=kase.title}}
>   <br/>
>   <br/>
>   {{=kase.body}}
>   <br/>
>   <br/>
>   
> </div>
>
> <div class="row ">
>   <h3 class="btn btn-large btn-block btn-success  span4 offset4">  ((( 
> العروض  ))) </h3>
> </div>
>
> <a href="#myModal" class="btn offset8" data-toggle="modal">اضافة عرض</a>
>
> <div class="modal hide fade" id="myModal" aria-hidden="true">            
>   <div class="modal-header center" >
>     <h4 class="btn btn-large btn-block btn-success ">اضافة عرض</h4>
>   </div>
>   <div class="modal-body" >
>     {{=form}}
>   </div>
>   <div class="modal-footer" >
>     <button class="btn" data-dismiss="modal" 
> aria-hidden="true">Close</button>
>   </div>
> </div>
>
>
> <table class="table table-striped ">
>   <thead >
>     <tr>
>       {{if kase_volunteers : }}
>       <th >العروض</th>
>       {{pass}}
>     </tr>    
>   </thead>
>   <tbody align="left">
>     {{for k,volunteer in enumerate(kase_volunteers):}}   
>     <tr>
>        <td class="span2">{{=(volunteer.volunteer.on_date)}}</td>
>
>        <td class="span2">{{=(volunteer.volunteer.title)}}</td>
>        <td class="span8">{{=(volunteer.volunteer.body)}}</td>
>
>        {{if (volunteer.volunteer.valid==True): }}
>        <td class="span2">فعال</td>
>        {{else:}}
>        <td class="span2">موقوف</td>
>        {{pass}}
>
>        <td class="btn btn-success">العـــــرض</td>   
>        <td class="btn">{{=A('مستندات',_href=URL('volunteer_document_r', 
> args=volunteer.volunteer.id))                 }}</td>
>
>        {{if (volunteer.volunteer.valid==True): }}
>        <td class="btn">{{=A('مراسلات', _href=URL('volunteer_comment',   
>  args=volunteer.volunteer.id)) 
>        {{else:}}
>        <td class="btn">{{=A('مراسلات', _href=URL('volunteer_comment_r', 
>  args=volunteer.volunteer.id)) 
>        {{pass}}
>
>        <td>*</td>
>        <td class="btn btn-danger">الحالات</td>  
>        <td class="btn">{{=A('الحالات', _href=URL('volunteer_kase',       
> args=[volunteer.volunteer.id,current_cat_id]))}}</td>
>      </tr>
>     
>      {{pass}}
>     
>   </tbody>
> </table>
>
>
> On Monday, October 1, 2012 2:26:56 PM UTC+3, Loreia wrote:
>>
>> Why didn't you post your solution??? 
>> This is the top result in Google search for "SocketTimeout: Socket timed 
>> out before request." and still there is no resolution of the problem.
>>
>> So, after spending two hours on this, let me save other novices from 
>> going down the same route:
>> This error happens when you forget to close if-else block with a "pass" 
>> statement
>>
>> Example:
>> This will generate the error:
>> {{
>> if myVar:
>> response.write(uploadContent)
>> }}
>>
>> This will work as expected:
>> {{
>> if myVar:
>> response.write(uploadContent)
>> pass
>> }}
>>
>> A small suggestion for devs: update error message to mention possible 
>> missing "pass" statement.
>>
>> Thank you and BR
>> Loreia
>>
>>
>>
>> On Thursday, March 3, 2011 6:27:00 AM UTC+1, Lennon wrote:
>>>
>>> PROBLEM SOLVED 
>>>
>>> Stupid Mistake. 
>>>
>>> Please close/delete thread if possible or let me know how I can 
>>> accomplish that. 
>>>
>>> On Mar 3, 12:07 am, Lennon <[email protected]> wrote: 
>>> > Let me also add that I have: 
>>> > 
>>> > num_trav -= 1 
>>> > 
>>> > in the appropriate place to prevent an infinite loop that might be 
>>> > causing this.  But according to the debugger, the function isn't 
>>> > making it past: 
>>> > 
>>> > for k, v in request.vars.items() 
>>> > 
>>> > anyway. 
>>> > 
>>> > On Mar 2, 11:58 pm, Lennon <[email protected]> wrote: 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > 
>>> > > The following code got me a socket timeout error: 
>>> > 
>>> > > for trip in session.trip_cart: 
>>> > >     t_id = trip['trip_instance'] 
>>> > >     num_trav = trip['quantity'] - 1 
>>> > >     while num_trav > 0: 
>>> > >         new_trav = dict() 
>>> > >         for k, v in request.vars.items(): 
>>> > >             #get the field's trip_instance number 
>>> > >             #rest of code omitted. 
>>> > 
>>> > > Traceback (most recent call last): 
>>> > >   File "C:\Users\Lennon\workspace\web2py_source\gluon\rocket.py", 
>>> line 
>>> > > 1064, in run 
>>> > >     self.run_app(conn) 
>>> > >   File "C:\Users\Lennon\workspace\web2py_source\gluon\rocket.py", 
>>> line 
>>> > > 1531, in run_app 
>>> > >     self.environ = environ = self.build_environ(sock_file, conn) 
>>> > >   File "C:\Users\Lennon\workspace\web2py_source\gluon\rocket.py", 
>>> line 
>>> > > 1363, in build_environ 
>>> > >     request = self.read_request_line(sock_file) 
>>> > >   File "C:\Users\Lennon\workspace\web2py_source\gluon\rocket.py", 
>>> line 
>>> > > 1138, in read_request_line 
>>> > >     raise SocketTimeout("Socket timed out before request.") 
>>> > > SocketTimeout: Socket timed out before request. 
>>> > 
>>> > > Through use of the debugger I've determined that the line that is 
>>> > > causing the error is: 
>>> > 
>>> > > for k, v in request.vars.items() 
>>> > 
>>> > > This is strange to me because I've used that same line in other 
>>> places 
>>> > > but I've never had a problem with it. 
>>> > 
>>> > > One possibility is that this code is part of a larger function (so 
>>> now 
>>> > > the function maybe takes too long?), but a the function ran fine 
>>> > > before the above code was added.  I see that the socket times out 
>>> > > after 10 seconds but this error seems to happen almost 
>>> instantaneously 
>>> > > when I submit my form. 
>>> > 
>>> > > One last strange occurrence is that when I clicked the ticket for 
>>> the 
>>> > > above error, Google Chrome opened the ticket and also popped up the 
>>> > > following message in an alert box: 
>>> > 
>>> > > "Exception during snapshot rendering: Traceback (most recent call 
>>> > > last): 
>>> > > File 
>>> > > "C:path_to_my_web2py/admin/viewsdefault/ticket.html", line 
>>> > > 170, in <module> 
>>> > > KeyError: 'request' 
>>> > 
>>> > > I've never had Google Chrome pop up an alert for any of my tickets 
>>> > > although this might be unrelated.
>>
>>

-- 



Reply via email to