mirror of
https://github.com/9001/copyparty.git
synced 2025-08-17 00:52:16 -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():
|
||||
dp, fn = os.path.split(sys.argv[1])
|
||||
msg = "🏷️ {}\n📁 {}".format(fn, dp)
|
||||
fp = sys.argv[1]
|
||||
dp, fn = os.path.split(fp)
|
||||
try:
|
||||
sz = humansize(os.path.getsize(fp))
|
||||
except:
|
||||
sz = "?"
|
||||
|
||||
msg = "{} ({})\n📁 {}".format(fn, sz, dp)
|
||||
title = "File received"
|
||||
|
||||
if "com.termux" in sys.executable:
|
||||
|
|
Loading…
Reference in a new issue