api/examples: Rework sys.path computation
(imported from commit 6e4c2a9b5f5ab6f6680704a1e06bd17fd95bd038)
This commit is contained in:
parent
602ec5cfbf
commit
4a62308ab9
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """get-public-streams --user=<email address> [options]
|
usage = """get-public-streams --user=<email address> [options]
|
||||||
|
@ -45,7 +45,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """list-subscriptions --user=<email address> [options]
|
usage = """list-subscriptions --user=<email address> [options]
|
||||||
|
@ -45,7 +45,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """print-messages --user=<email address> [options]
|
usage = """print-messages --user=<email address> [options]
|
||||||
|
@ -45,7 +45,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """print-next-message --user=<email address> [options]
|
usage = """print-next-message --user=<email address> [options]
|
||||||
|
@ -45,7 +45,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """send-message [options] <recipient>
|
usage = """send-message [options] <recipient>
|
||||||
|
@ -54,7 +54,7 @@ parser.add_option('--type',
|
||||||
if len(args) == 0:
|
if len(args) == 0:
|
||||||
parser.error("You must specify recipients")
|
parser.error("You must specify recipients")
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.sender,
|
client = api.common.HumbugAPI(email=options.sender,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """subscribe --user=<email address> [options] --streams=<streams>
|
usage = """subscribe --user=<email address> [options] --streams=<streams>
|
||||||
|
@ -49,7 +49,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# SOFTWARE.
|
# SOFTWARE.
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
from os import path
|
||||||
import optparse
|
import optparse
|
||||||
|
|
||||||
usage = """unsubscribe --user=<email address> [options] --streams=<streams>
|
usage = """unsubscribe --user=<email address> [options] --streams=<streams>
|
||||||
|
@ -49,7 +49,7 @@ parser.add_option('--user',
|
||||||
action='store')
|
action='store')
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
|
sys.path.append(path.join(path.dirname(__file__), '../..'))
|
||||||
import api.common
|
import api.common
|
||||||
client = api.common.HumbugAPI(email=options.user,
|
client = api.common.HumbugAPI(email=options.user,
|
||||||
api_key=options.api_key,
|
api_key=options.api_key,
|
||||||
|
|
Loading…
Reference in a new issue