Skip to content
This repository

Added a timestamp option #29

Closed
wants to merge 1 commit into from

1 participant

Claus Witt
Claus Witt

Hi

I had some friends on twitter that needed a timestamp option, to ensure that images did not get overwritten.

Claus Witt clauswitt closed this March 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 6 additions and 0 deletions. Show diff stats Hide diff stats

  1. 6  webkit2png
6  webkit2png
@@ -81,6 +81,10 @@ class WebkitLoad (Foundation.NSObject, WebKit.protocols.WebFrameLoadDelegate):
81 81
          import time
82 82
          now = time.strftime("%Y%m%d")
83 83
          filename = now + "-" + filename
  84
+       if options.timestamp: 
  85
+         import time
  86
+         now = time.strftime("%Y%m%d%H%M%S")
  87
+         filename = now + "-" + filename
84 88
        import os
85 89
        dir = os.path.abspath(os.path.expanduser(options.dir))
86 90
        if not os.path.exists(options.dir):
@@ -235,6 +239,8 @@ examples:
235 239
        help="only create clipped thumbnail screenshot")
236 240
     cmdparser.add_option("-d", "--datestamp", action="store_true",
237 241
        help="include date in filename")
  242
+    cmdparser.add_option("-t", "--timestamp", action="store_true",
  243
+      help="include date and time in filename") 
238 244
     cmdparser.add_option("-D", "--dir",type="string",default="./",
239 245
        help="directory to place images into")
240 246
     cmdparser.add_option("--delay",type="float",default=0,
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.