-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #203 from deviloper-lab/master
PR von deviloper-lab
- Loading branch information
Showing
52 changed files
with
24,836 additions
and
19,764 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import doorpi | ||
from doorpi.action.base import SingleAction | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
logger.debug("%s loaded", __name__) | ||
|
||
from doorpi.action.base import SingleAction | ||
import doorpi | ||
logger.debug('%s loaded', __name__) | ||
|
||
|
||
def call(number): | ||
doorpi.DoorPi().sipphone.call(number) | ||
def call(number): doorpi.DoorPi().sipphone.call(number) | ||
|
||
def get(parameters): | ||
parameter_list = parameters.split(',') | ||
if len(parameter_list) is not 1: return None | ||
if len(parameter_list) is not 1: | ||
return None | ||
|
||
number = parameter_list[0] | ||
return CallAction(call, number=number) | ||
|
||
return CallAction(call, number = number) | ||
|
||
class CallAction(SingleAction): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
import doorpi | ||
from doorpi.action.base import SingleAction | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
logger.debug("%s loaded", __name__) | ||
logger.debug('%s loaded', __name__) | ||
|
||
import doorpi | ||
from doorpi.action.base import SingleAction | ||
|
||
def call_phonenumber_from_file(filename): | ||
try: | ||
with open(doorpi.DoorPi().parse_string(filename), 'r') as f: | ||
phonenumber = f.readline().strip(' \t\n\r') | ||
|
||
logger.debug("firing sipphone.call for this number: %s", phonenumber) | ||
logger.debug('firing sipphone.call for this number: %s', phonenumber) | ||
doorpi.DoorPi().sipphone.call(phonenumber) | ||
logger.debug("finished sipphone.call for this number: %s", phonenumber) | ||
logger.debug('finished sipphone.call for this number: %s', phonenumber) | ||
|
||
except Exception as ex: | ||
logger.exception("couldn't get phonenumber from file (%s)", ex) | ||
logger.exception('could not get phonenumber from file (%s)', ex) | ||
return False | ||
return True | ||
|
||
def get(parameters): | ||
return CallPhoneNumberFromFileAction(call_phonenumber_from_file, filename = parameters) | ||
return CallPhoneNumberFromFileAction(call_phonenumber_from_file, filename=parameters) | ||
|
||
|
||
class CallPhoneNumberFromFileAction(SingleAction): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
logger.debug("%s loaded", __name__) | ||
|
||
import doorpi | ||
from doorpi.action.base import SingleAction | ||
|
||
from time import sleep | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
logger.debug('%s loaded', __name__) | ||
|
||
|
||
def hangup(waittime): | ||
logger.trace("hangup requested") | ||
if waittime > 0: | ||
logger.debug("Waiting %s seconds before sending hangup request", waittime) | ||
logger.debug('Waiting %s seconds before sending hangup request', waittime) | ||
sleep(float(waittime)) | ||
return doorpi.DoorPi().sipphone.hangup() | ||
|
||
def get(parameters): | ||
if not parameters.isdigit(): return None | ||
if not parameters.isdigit(): | ||
return None | ||
return HangupAction(hangup, parameters) | ||
|
||
|
||
class HangupAction(SingleAction): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
from doorpi.action.base import SingleAction | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
logger.debug("%s loaded", __name__) | ||
logger.debug('%s loaded', __name__) | ||
|
||
from doorpi.action.base import SingleAction | ||
|
||
def log(message): | ||
logger.debug(message) | ||
def log(message): logger.debug(message) | ||
|
||
def get(parameters): | ||
parameter_list = parameters.split(',') | ||
if len(parameter_list) is not 1: return None | ||
if len(parameter_list) is not 1: | ||
return None | ||
|
||
message = parameter_list[0] | ||
|
||
return LogAction(log, message) | ||
|
||
class LogAction(SingleAction): | ||
pass | ||
pass |
Oops, something went wrong.