[sip/sms] Indentation fail
This commit is contained in:
parent
399bf75dbe
commit
f8f4d7e9ec
2 changed files with 13 additions and 28 deletions
|
@ -66,7 +66,7 @@ class Sms(object):
|
|||
except (socket.error, asterisk.NullRecv):
|
||||
pass
|
||||
|
||||
def _mkdirs(path):
|
||||
def _mkdirs(self, path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exc:
|
||||
|
@ -77,18 +77,18 @@ class Sms(object):
|
|||
def sms_delay(self, src, dst, body, user, body_type='str'):
|
||||
if not body_type in ["str", "base64"]:
|
||||
raise EnvironmentError("body_type sould be 'str' ou 'base64' not %r" % body_type)
|
||||
date = datetime.now().strftime('%Y%m%d%H%M%S.%f')
|
||||
path = self.sms_dir + user + '/' + date + '/'
|
||||
self._mkdirs(path)
|
||||
with open(path + 'from') as f:
|
||||
f.write(src)
|
||||
with open(path + 'to') as f:
|
||||
f.write(dst)
|
||||
with open(path + 'body') as f:
|
||||
if body_type=='str':
|
||||
f.write(body)
|
||||
elif body_type=='base64':
|
||||
f.write(base64.encodestring(body).strip())
|
||||
date = datetime.now().strftime('%Y%m%d%H%M%S.%f')
|
||||
path = self.sms_dir + user + '/' + date + '/'
|
||||
self._mkdirs(path)
|
||||
with open(path + 'from', 'w') as f:
|
||||
f.write(src)
|
||||
with open(path + 'to', 'w') as f:
|
||||
f.write(dst)
|
||||
with open(path + 'body', 'w') as f:
|
||||
if body_type=='str':
|
||||
f.write(body)
|
||||
elif body_type=='base64':
|
||||
f.write(base64.encodestring(body).strip())
|
||||
|
||||
|
||||
|
||||
|
@ -311,17 +311,3 @@ class Manager(object):
|
|||
if body_type == "str":
|
||||
body = base64.encodestring(body).strip()
|
||||
return self._action('messageSend', {'to':dst, 'from':src, 'base64body':body})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue