def main(): if (len(sys.argv) < 3): print "Usage: <action> <payload> <stage name> <env name> <version>" print "action: getBuilds" sys.exit(0) app = Flask(__name__) formJson = utils.parseJson(sys.argv[2]) if (len(sys.argv) == 4): stage = sys.argv[3] env = "" version = "" elif (len(sys.argv) == 6): stage = sys.argv[3] env = sys.argv[4] version = sys.argv[5] elif (len(sys.argv) == 5): stage = sys.argv[3] env = sys.argv[4] version = "" else: stage = "" env = "" version = "" teletraan = Teletraan(app, sys.argv[1], formJson, stage, env, version)
def main(): if ( len(sys.argv) < 2 ): print "Usage: <payload>" sys.exit() formJson=utils.parseJson(sys.argv[1]) print ">>>" ecsStatus=EcsStatus("like",formJson) ecsStatus.status() ecsStatus=EcsStatus("prod",formJson) ecsStatus.status()
def main(): if (len(sys.argv) < 3): print "Usage: <action> <payload> <services> <env>" sys.exit(0) app = Flask(__name__) action = sys.argv[1] services = sys.argv[3] env = sys.argv[4] formJson = utils.parseJson(sys.argv[2]) restart = Restart(app, action, formJson, services, env)
def parse_users(): printStartParsing("users") all_users = utils.parseJson(("user_id",), filepath+'yelp_academic_dataset_user.json') printParseSucceed("users") return all_users
def parse_restaurants(): printStartParsing("restaurants") all_restaurants = utils.parseJson(("business_id",), filepath+'yelp_academic_dataset_business.json') printParseSucceed("restaurants") return all_restaurants
def parse_reviews(): printStartParsing("reviews") all_reviews = utils.parseJson(("user_id","business_id"), filepath+'yelp_academic_dataset_review.json') printParseSucceed("reviews") return all_reviews
#!/usr/bin/python import sys,os scriptDir=os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, scriptDir + "/../") import utils from slackclient import SlackClient from slack_config import SlackConfig if ( len(sys.argv) < 2 ): print("Usage: <payload>") sys.exit() payload=utils.parseJson(sys.argv[1]) channelName=payload["channel"]["name"] channelId=payload["channel"]["id"] slackConfig=SlackConfig() SLACK_BOT_TOKEN = slackConfig.get("SLACK_BOT_TOKEN") slack_client = SlackClient(SLACK_BOT_TOKEN) print("in example.py") response = slack_client.api_call( "chat.postMessage", channel=channelId, mrkdwn=True, text="*hello from python example*" )