Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions escrotum/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import datetime
import subprocess
import argparse
import uuid

import gtk
import cairo
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down