Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!81.171.88.16.MISMATCH!hq-usenetpeers.eweka.nl!hq-usenetpeers.eweka.nl!bcyclone01.am1.xlned.com!bcyclone01.am1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.062 X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'socket': 0.07; 'sys': 0.07; 'spaces': 0.09; 'def': 0.12; 'httperror': 0.16; 'tab': 0.16; 'url:windows': 0.16; 'subject:python': 0.16; 'import': 0.22; 'issue.': 0.22; 'error': 0.23; 'recognize': 0.24; 'options': 0.25; 'skip:" 30': 0.26; 'skip:" 40': 0.26; 'downloaded': 0.26; 'skip:" 20': 0.27; 'skip:_ 20': 0.27; 'tried': 0.27; '8bit%:3': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'getting': 0.31; '"': 0.31; 'indentation': 0.31; "skip:' 40": 0.31; 'file': 0.32; 'class': 0.32; 'run': 0.32; 'skip:& 30': 0.33; 'subject:with': 0.35; 'received:209.85': 0.35; 'skip:s 30': 0.35; 'editor': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'error.': 0.37; 'received:209': 0.37; 'expected': 0.38; 'skip:& 10': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'skip:_ 30': 0.39; 'skip:& 20': 0.39; 'to:addr:python.org': 0.39; 'space': 0.40; 'skip:a 30': 0.61; 'such': 0.63; 'different': 0.65; 'between': 0.67; 'skip:r 40': 0.68; 'skip:r 30': 0.69; 'skip:* 70': 0.78; 'azure': 0.84; 'httprequest,': 0.84; 'syed': 0.84 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=xBGJ6PrLIjv3lo1Wz81CqmHKzb75t8WDKn8x04YrqUM=; b=CzA06X72xpUA9f5m76t6/Jw+LYNbfuD/X5PFBlPgpCLwCZU+TtnwdSW074nCukxE4A ZxqWdwE5thOBTTgHJ2Z/zL7IEDLSjmkx3+fBskifycIwozwHCqL2iFH57LSRZvDP0UaR 4tiYZ2QOsrJz1XSyYuDOo8l4HA7S2zJAMnToWfQ3/EDqGZMivWu69DogyBbyApDwn9cT Fdk/gIaVvEeR9rXZ/OnjFFYMmZoKAIsU/gl7+9gtnvPfdJiN2ycZ5/AWmLim5ZnjWflq GaSglUJe4lHmBnGYjKSqTOQ5QGw9hW355PQiRgE9buXUiUfHvWGdvGJ68H903otaotgZ tpJg== X-Gm-Message-State: ALoCoQn903booDkDkPD716Ned6k4KICUWeclKFbsnNaljzs8l/2mWKUgjT/OeYYA7HBYI8ve+yOo MIME-Version: 1.0 X-Received: by 10.152.29.6 with SMTP id f6mr1304618lah.82.1423105673886; Wed, 04 Feb 2015 19:07:53 -0800 (PST) X-Originating-IP: [98.155.101.136] Date: Wed, 4 Feb 2015 19:07:53 -0800 Subject: Indentation issues with python From: syed khalid To: python-list@python.org Content-Type: multipart/alternative; boundary=089e0158c78a2b9516050e4e9c63 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 105 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1423105677 news.xs4all.nl 2859 [2001:888:2000:d::a6]:40674 X-Complaints-To: abuse@xs4all.nl X-Received-Body-CRC: 1793377056 X-Received-Bytes: 7703 Xref: csiph.com comp.lang.python:85244 --089e0158c78a2b9516050e4e9c63 Content-Type: text/plain; charset=UTF-8 I downloaded this code and am attempting to run it. I keep getting indentation error. there is a way to handle it with a editor which can recognize the tab or space issue. I have tried different options such as 2 or 3 spaces or tab to no avail. I have encased the error mesage with line 23 between "****************" import sys import azure import socket from azure.servicebus import ( _service_bus_error_handler ) from azure.servicebus.servicebusservice import ( ServiceBusService, ServiceBusSASAuthentication ) from azure.http import ( HTTPRequest, HTTPError ) from azure.http.httpclient import _HTTPClient class EventHubClient(object): def sendMessage(self,body,partition):eventHubHost = "pac-ns.servicebus.windows.net" httpclient = _HTTPClient(service_instance=self) ******************************************************************** File "test1.py", line 23 def sendMessage(self,body,partition): ^ IndentationError: expected an indented block *********************************************************************** sasKeyName = "SendPolicy" sasKeyValue = "erENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU=" authentication = ServiceBusSASAuthentication(sasKeyName,sasKeyValue) request = HTTPRequest() request.method = "POST" request.host = eventHubHost request.protocol_override = "https" request.path = "/myhub/publishers/" + partition + "/messages?api-version=2014-05 " request.body = body request.headers.append(('Content-Type', 'application/atom+xml;type=entry;charset =utf-8')) authentication.sign_request(request, httpclient) request.headers.append(('Content-Length', str(len(request.body))) -- *Syed Khalid* --089e0158c78a2b9516050e4e9c63 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I downloaded this code and am attempting to run it. I kee= p getting=20 indentation error. there=20 is a way to handle it with a editor which can recognize the tab or=20 space issue. I have tried different options such as 2 or 3 spaces or tab to= no avail.

I have encased the error mesage with line 23 between &quo= t;****************"

import sys
import azure
import socket=
=C2=A0
from azure.servicebus import (
_service_bus_error_handler<= br>)
=C2=A0
from azure.servicebus.servicebusservice import (
Servi= ceBusService,
ServiceBusSASAuthentication
)
=C2=A0
from azure.h= ttp import (
HTTPRequest,
HTTPError
)
=C2=A0
from azure.http= .httpclient import _HTTPClient
=C2=A0
class EventHubClient(object):def sendMessage(self,body,partition):eventHubHost =3D
"pac-ns.servicebus.windows.net&qu= ot;
=C2=A0=C2=A0=C2=A0 httpclient =3D _HTTPClient(service_instance=3Dsel= f)
=C2=A0***************************************************************= *****
File "test1.py", line 23
=C2=A0=C2=A0=C2=A0 def sendM= essage(self,body,partition):
^
IndentationError: expected an indented= block
*****************************************************************= ******
sasKeyName =3D "SendPolicy"
sasKeyValue =3D "er= ENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU=3D"
=C2=A0
authenticat= ion =3D ServiceBusSASAuthentication(sasKeyName,sasKeyValue)
=C2=A0
re= quest =3D HTTPRequest()
request.method =3D "POST"
request.h= ost =3D eventHubHost
request.protocol_override =3D "https"
= request.path =3D "/myhub/publishers/" + partition + "/messag= es?api-version=3D2014-05
"
request.body =3D body
request.head= ers.append(('Content-Type', 'application/atom+xml;type=3Dentry;= charset
=3Dutf-8'))
=C2=A0
authentication.sign_request(request= , httpclient)
=C2=A0
request.headers.append(('Content-Length'= , str(len(request.body)))



--
Syed Khalid
--089e0158c78a2b9516050e4e9c63--