diff --git a/README.rst b/README.rst index 002983e..520ee10 100644 --- a/README.rst +++ b/README.rst @@ -41,6 +41,7 @@ Features The following specifiers are recognised: $w image width $h image height + $u random uuid Example: escrotum '%Y-%m-%d_$wx$h_scrotum.png' Creates a file called something like 2013-06-17-082335_263x738_escrotum.png diff --git a/escrotum/main.py b/escrotum/main.py index ee27cbd..12f88e8 100755 --- a/escrotum/main.py +++ b/escrotum/main.py @@ -5,6 +5,7 @@ import datetime import subprocess import argparse +import uuid import gtk import cairo @@ -341,6 +342,7 @@ def _expand_argument(self, width, height, string): string = datetime.datetime.now().strftime(string) string = string.replace("$w", str(width)) string = string.replace("$h", str(height)) + string = string.replace("$u", str(uuid.uuid4())) string = os.path.expanduser(string) return string @@ -412,6 +414,7 @@ def get_options(): \t$f image path/filename (ignored when used in the filename) \t$w image width \t$h image height + \t$u random uuid Example: \tescrotum '%Y-%m-%d_$wx$h_escrotum.png' \tCreates a file called something like 2013-06-17-082335_263x738_escrotum.png