Compare commits

..

No commits in common. "a531a1550da286365409087dd5fc82235855ef92" and "f9d1c49e1961433a0f0613acddca60cd85b5cb89" have entirely different histories.

3 changed files with 4 additions and 9 deletions

View File

@ -1,5 +1,2 @@
TellMe (1.3.0)
* Add support for mentions (-n)
TellMe (1.2.0) TellMe (1.2.0)
* Feature complete version * Feature complete version

View File

@ -1,6 +1,6 @@
{ {
"name": "TellMe", "name": "TellMe",
"version": "1.3.0", "version": "1.2.0",
"description": "TellMe CLI", "description": "TellMe CLI",
"scripts": { "scripts": {
"dev": "webpack-dev-server --inline --hot" "dev": "webpack-dev-server --inline --hot"

View File

@ -18,7 +18,7 @@ def signal_handler(signal, frame):
print('Exit...') print('Exit...')
sys.exit(0) sys.exit(0)
def sendmessage(message): def sendmessage (message):
global ran global ran
# mymessage=hostname.upper() + ': ' +message # mymessage=hostname.upper() + ': ' +message
mymessage = ("%s on %s" % (message, hostname.upper())) mymessage = ("%s on %s" % (message, hostname.upper()))
@ -29,7 +29,6 @@ def sendmessage(message):
url = ("%s/api/webhook/%s" % (baseurl, webhook)) url = ("%s/api/webhook/%s" % (baseurl, webhook))
myreq = {} myreq = {}
myreq['message'] = mymessage myreq['message'] = mymessage
myreq['notify'] = notify
r = requests.post(url, json = { 'message': mymessage, 'tts': args.tts }) r = requests.post(url, json = { 'message': mymessage, 'tts': args.tts })
if r.status_code == 200: if r.status_code == 200:
@ -41,7 +40,7 @@ def sendmessage(message):
ran = True ran = True
__version__ = "1.3.0" __version__ = "1.2.0"
versionstring='TellMe v' + __version__ versionstring='TellMe v' + __version__
signal.signal(signal.SIGINT, signal_handler) signal.signal(signal.SIGINT, signal_handler)
@ -54,8 +53,7 @@ parser.add_argument("-m", "--message", default="Your process finished", help="Me
parser.add_argument('-t', '--tts', default=False, action='store_true', help="Send message to TTS") parser.add_argument('-t', '--tts', default=False, action='store_true', help="Send message to TTS")
parser.add_argument('-v', '--version', action='version', version=versionstring) parser.add_argument('-v', '--version', action='version', version=versionstring)
parser.add_argument('-p', '--pid', action="store", dest="pid", type=int, default=0) parser.add_argument('-p', '--pid', action="store", dest="pid", type=int, default=0)
parser.add_argument('-n', '--notify', action="store", dest="notify", default=None, help="Notify specific id") parser.add_argument('-n', '--interval', action="store", dest="interval", type=int, default=5, help="Set the interval of commands like watch that use it")
parser.add_argument('-i', '--interval', action="store", dest="interval", type=int, default=5, help="Set the interval of commands like watch that use it")
parser.add_argument('-w', '--watch', action="store", dest="watchcommand", help="Run the given command every n or 5 minutes") parser.add_argument('-w', '--watch', action="store", dest="watchcommand", help="Run the given command every n or 5 minutes")
parser.add_argument('-c', '--config', default=home +"/.config/tellme/config.json" ,help="Path to config file") parser.add_argument('-c', '--config', default=home +"/.config/tellme/config.json" ,help="Path to config file")
parser.add_argument('-P', '--ping', action="store", dest="pinghost", type=str, help="Ping a host until it is up") parser.add_argument('-P', '--ping', action="store", dest="pinghost", type=str, help="Ping a host until it is up")