Code: Select all
from os import path
fp = eg.event.payload[0]
head, tail = path.split(fp)
name, ext = path.splitext(tail)
eg.result = "New Episode of %s" % name
eg.globals.testVar = eg.resultI am trying to create a similar one that gives me just the path of the file instead of just the file name.
example event.payload: (u'\\\\HTPC\\Torrent-Finished\\TV\\exampleShow\\example.mkv',)
I would like to get: "\\HTPC\Torrent-Finished\TV\exampleShow"
I will then create a variable with that result and use the variable for a path in a command line operation. I'm also not sure if I can use expressions like {eg.globals.testVar} in the Start Application actions command line area of evenghost. I was able to use {eg.globals.testVar} in fields of the E-mail plugin before....edit expressions do work fine in the command line field.
I've been trying to figure this out myself with no real python knowledge. It looks like i need to figure out the:
Code: Select all
head, tail = path.split(fp)
name, ext = path.splitext(head)
eg.result = nameCode: Select all
from os import path
fp = eg.event.payload[0]
head, tail = path.split(fp)
name, ext = path.splitext(head)
eg.result = name
eg.globals.miscPath = eg.result
print eg.globals.miscPath