api/examples: Rework sys.path computation

(imported from commit 6e4c2a9b5f5ab6f6680704a1e06bd17fd95bd038)
This commit is contained in:
Keegan McAllister 2012-11-26 12:17:35 -05:00
parent 602ec5cfbf
commit 4a62308ab9
7 changed files with 14 additions and 14 deletions

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """get-public-streams --user=<email address> [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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """list-subscriptions --user=<email address> [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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """print-messages --user=<email address> [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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """print-next-message --user=<email address> [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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """send-message [options] <recipient>
@ -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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """subscribe --user=<email address> [options] --streams=<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,

View file

@ -22,7 +22,7 @@
# SOFTWARE.
import sys
import os
from os import path
import optparse
usage = """unsubscribe --user=<email address> [options] --streams=<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,