From 4a62308ab94aa4586839c80d15f73f7b3b79f5e3 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 26 Nov 2012 12:17:35 -0500 Subject: [PATCH] api/examples: Rework sys.path computation (imported from commit 6e4c2a9b5f5ab6f6680704a1e06bd17fd95bd038) --- examples/get-public-streams | 4 ++-- examples/list-subscriptions | 4 ++-- examples/print-messages | 4 ++-- examples/print-next-message | 4 ++-- examples/send-message | 4 ++-- examples/subscribe | 4 ++-- examples/unsubscribe | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/get-public-streams b/examples/get-public-streams index 8eb2e63..58fa1da 100755 --- a/examples/get-public-streams +++ b/examples/get-public-streams @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """get-public-streams --user= [options] @@ -45,7 +45,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key, diff --git a/examples/list-subscriptions b/examples/list-subscriptions index 57a7abd..df91516 100755 --- a/examples/list-subscriptions +++ b/examples/list-subscriptions @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """list-subscriptions --user= [options] @@ -45,7 +45,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key, diff --git a/examples/print-messages b/examples/print-messages index 2a8e7a7..afa2af0 100755 --- a/examples/print-messages +++ b/examples/print-messages @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """print-messages --user= [options] @@ -45,7 +45,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key, diff --git a/examples/print-next-message b/examples/print-next-message index 191a570..f5e919f 100755 --- a/examples/print-next-message +++ b/examples/print-next-message @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """print-next-message --user= [options] @@ -45,7 +45,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key, diff --git a/examples/send-message b/examples/send-message index 85d13cd..97b7b8d 100755 --- a/examples/send-message +++ b/examples/send-message @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """send-message [options] @@ -54,7 +54,7 @@ parser.add_option('--type', if len(args) == 0: 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 client = api.common.HumbugAPI(email=options.sender, api_key=options.api_key, diff --git a/examples/subscribe b/examples/subscribe index 1f07cbb..d776941 100755 --- a/examples/subscribe +++ b/examples/subscribe @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """subscribe --user= [options] --streams= @@ -49,7 +49,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key, diff --git a/examples/unsubscribe b/examples/unsubscribe index eaf7cc3..3dd363b 100755 --- a/examples/unsubscribe +++ b/examples/unsubscribe @@ -22,7 +22,7 @@ # SOFTWARE. import sys -import os +from os import path import optparse usage = """unsubscribe --user= [options] --streams= @@ -49,7 +49,7 @@ parser.add_option('--user', action='store') (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 client = api.common.HumbugAPI(email=options.user, api_key=options.api_key,