<commit_before>#!/usr/bin/env python

import subprocess
import argparse

parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")

parser.set_defaults(station=None, train=None, date=None)

args = parser.parse_args()

def main():
    def run_command(cmd_array, shell=False):
        p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
        out, err = p.communicate()
        return out

    command = ['phantomjs', 'trainStatus.js']
    if args.station:
        command.append(str(args.station))
    if args.train:
        command.append(str(args.train))
    if args.date:
        command.append(str(args.date))

    print "Executing {}".format(command)
    text = run_command(command)
    tweet = text.split("-" * 3)
    result = run_command(['node', 'twitter.js', tweet[1]])
    print result

if __name__ == "__main__":
    main()
<commit_msg>Use full paths & print our current command fully<commit_after>#!/usr/bin/env python

import subprocess
import argparse
import os

parser = argparse.ArgumentParser(description="Tweet some Train Statuses!")
parser.add_argument("-s", "--station", dest="station", type=str, help="Station Short Code. Ex: 'SLM'")
parser.add_argument("-t", "--train", dest="train", type=int, help="Train Number. Ex: '500'")
parser.add_argument("-d", "--date", dest="date", type=str, help="Date. MM/DD/YYYY")

parser.set_defaults(station=None, train=None, date=None)

args = parser.parse_args()

def main():
    def run_command(cmd_array, shell=False):
        print "Executing `{}`".format(cmd_array)
        p = subprocess.Popen(cmd_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=shell)
        out, err = p.communicate()
        return out

    command = ['phantomjs', "{}/trainStatus.js".format(os.getcwd())]
    if args.station:
        command.append(str(args.station))
    if args.train:
        command.append(str(args.train))
    if args.date:
        command.append(str(args.date))

    text = run_command(command)
    tweet = text.split("-" * 3)
    result = run_command(['node', "{}/twitter.js".format(os.getcwd()), tweet[1]])
    print result

if __name__ == "__main__":
    main()

{'fraction_non_alphanumeric': 0.169566976932416, 'fraction_numerical': 0.004046944556859571, 'mean_word_length': 4.034623217922607, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1401582', 'n_tokens_mistral': 827, 'n_tokens_neox': 816, 'n_words': 177}