mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 09:02:15 -06:00
include filesize in notification
This commit is contained in:
parent
712a578e6c
commit
2f15bb5085
|
@ -26,9 +26,23 @@ parameters explained,
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
from copyparty.util import humansize
|
||||||
|
except:
|
||||||
|
|
||||||
|
def humansize(n):
|
||||||
|
return n
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
dp, fn = os.path.split(sys.argv[1])
|
fp = sys.argv[1]
|
||||||
msg = "🏷️ {}\n📁 {}".format(fn, dp)
|
dp, fn = os.path.split(fp)
|
||||||
|
try:
|
||||||
|
sz = humansize(os.path.getsize(fp))
|
||||||
|
except:
|
||||||
|
sz = "?"
|
||||||
|
|
||||||
|
msg = "{} ({})\n📁 {}".format(fn, sz, dp)
|
||||||
title = "File received"
|
title = "File received"
|
||||||
|
|
||||||
if "com.termux" in sys.executable:
|
if "com.termux" in sys.executable:
|
||||||
|
|
Loading…
Reference in a new issue