import requests

class LokingYQL(object):

  def __init__(self, table=None, format='json'):
    self.url = 'https://query.yahooapis.com/v1/public/yql'	  
    self.table = table
    self.format = format

  def __repr__(self):
    pass


  def queryBuilder(self, table):
    pass

  def payloadBuilder(self, query, format='json'):
    '''Build the payload'''
    payload = {
	'q' : query,
	'callback' : '', #This is not javascript
	'diagnostics' : 'true', # always true
	'format' : format
    }

    return payload

  def executeQuery(self, payload):
    '''Execute the query'''
    response = requests.get(self.url, params= payload)

    return response

  #
  # Actions
  #

  def select(self, table=None):
    '''This method simulate a select on a table'''
    try:
      self.current_table = table
    except Exception, e:
      print(e)

    return self

 def where(self, **conditions):
     ''' This method simulates a where condition. Use as follow:
         yql.select('mytable').where(dict)
     '''
     pass

  def showTables(self, format='json'):
    '''Return list of all avaible tables'''

    query = 'SHOW TABLES'
    payload = self.payloadBuilder(query, format) 	

    response = self.executeQuery(payload) 

    return response

@@ -232,52 +232,8 @@
 ss%0A%0A
-%0A  def queryBuilder(self, table):%0A    pass%0A%0A
   de
@@ -463,16 +463,339 @@
 ayload%0A%0A
+  def rawQuery(self, query, format='json'):%0A    '''Execute a YQL query and return response%0A       %3E%3E%3E...%0A       %3E%3E%3E resp = yql.rawQuery('select * from weather.forecast where woeid=2502265')%0A       %3E%3E%3E %0A    '''%0A    payload = self.payloadBuilder(query, format)%0A    response = self.executeQuery(payload)%0A%0A    return response%0A%0A
   def ex
@@ -1130,16 +1130,17 @@
 n self%0A%0A
+ 
  def whe
@@ -1152,10 +1152,8 @@
 lf, 
-**
 cond

fix #6 rawQuery OK