whimsical-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ru...@apache.org
Subject [whimsy] branch master updated: scan for images
Date Sun, 04 Jun 2017 20:25:19 GMT
This is an automated email from the ASF dual-hosted git repository.

rubys pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git

The following commit(s) were added to refs/heads/master by this push:
       new  6b3fa1c   scan for images
6b3fa1c is described below

commit 6b3fa1cf3d8735d65ea9e6b00af33eee330d28d6
Author: Sam Ruby <rubys@intertwingly.net>
AuthorDate: Sun Jun 4 16:25:07 2017 -0400

    scan for images
---
 tools/site-scan.rb | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/site-scan.rb b/tools/site-scan.rb
index f747f33..c883904 100755
--- a/tools/site-scan.rb
+++ b/tools/site-scan.rb
@@ -131,6 +131,8 @@ end
 
 #########################################################################
 
+IMAGE_DIR = ASF::SVN.find('asf/infrastructure/site/trunk/content/img')
+
 def parse(id, site, name)
   uri, response, status = $cache.get(id, site)
   $stderr.puts "#{id} #{uri} #{status}"
@@ -147,6 +149,7 @@ def parse(id, site, name)
     security: nil,
     trademarks: nil,
     copyright: nil,
+    image: nil,
   }
 
   # scan each link
@@ -215,6 +218,12 @@ def parse(id, site, name)
       data[:copyparent] = p if p
     end
   end
+
+  # see if image has been uploaded
+  if IMAGE_DIR
+    data[:image] = Dir["#{IMAGE_DIR}/#{id}.*"].first
+  end
+
   return data
 end
 
@@ -267,6 +276,8 @@ else
     results[committee.name] = parse(committee.name, committee.site, committee.display_name)
   end
 end
+
+# Output results
 if outfile
   File.write(outfile, JSON.pretty_generate(results))
 else

-- 
To stop receiving notification emails like this one, please contact
['"commits@whimsical.apache.org" <commits@whimsical.apache.org>'].

Mime
View raw message