gphotos 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f96e4a1dd6266042cf0098cf422aa06bfff070c
4
- data.tar.gz: 38e62cf9f413803f1dc318b2bfdaee09d9d7b181
3
+ metadata.gz: ca60cae44396023d5a11ffbe51ff0d84df3116a5
4
+ data.tar.gz: 6853345ab48a18e8087a073b005d01a4ebebadd2
5
5
  SHA512:
6
- metadata.gz: 43b2e28efec1c793817fc4dc900d1c8e20d287cca66c07a40314288affb141e99dc653df53c6775eb2e3044657db99ff68dc5e0baa05e480c575723d1f3788d4
7
- data.tar.gz: 1be3c894ed2989015af5d5c7100b127f0c0b820f7452c3c57386c830ae0f4d3befe7a53551c92523e630f8567462a2242ca5b126744aa7e03fa50124ce352a11
6
+ metadata.gz: 31f8ab4fae2816860c6fceabcfc46e0fdd66193dc3192a134a34992096c328adc7cc90d407cdf2c7b42b3bdd41a5ba55dd87f1dadc1332336b73c2c71eb61cfb
7
+ data.tar.gz: 5f1abec0b1187080289f88188fb64158e38b3b2419bfdd419666c3a07de5a6039dbdc251ad5859a0eb4cd632a3f3d9441b4ba907d7ed80ba43b8b6b7f24dfd33
@@ -79,10 +79,13 @@ module Gphotos
79
79
 
80
80
  puts 'upload:'
81
81
  uploaded, skipped, not_exist = gphotos.upload(files) do |file, status|
82
- if status == :uploaded
83
- puts "#{file}"
84
- else
85
- puts "#{file} (#{status})"
82
+ case status
83
+ when :uploading
84
+ print "#{file} ..."
85
+ when :skipped, :not_exist
86
+ puts "\b\b\b(#{status})"
87
+ when :uploaded
88
+ puts "\b\b\b "
86
89
  end
87
90
  end
88
91
 
@@ -5,7 +5,7 @@ module Gphotos
5
5
  class Gphotos
6
6
 
7
7
  def initialize(email, passwd, passwd_exec, options = {})
8
- options = {:page_timeout => 20, :upload_timeout => 3600 }.merge(options)
8
+ options = {:page_timeout => 20, :upload_timeout => 7200 }.merge(options)
9
9
  profile = Selenium::WebDriver::Chrome::Profile.new
10
10
  profile['profile.managed_default_content_settings.images'] = 2
11
11
  @driver = Selenium::WebDriver.for(:chrome, :profile => profile)
@@ -62,14 +62,15 @@ module Gphotos
62
62
  not_exist = []
63
63
  result = ''
64
64
  files.each do |file|
65
- file = File.expand_path(file)
66
- if !File.exists?(file)
65
+ block.call(file, :uploading)
66
+ full_path = File.expand_path(file)
67
+ if !File.file?(full_path)
67
68
  not_exist.push(file)
68
69
  block.call(file, :not_exist)
69
70
  next
70
71
  end
71
72
  current_result = ''
72
- element.send_keys(file)
73
+ element.send_keys(full_path)
73
74
  @wait.until do
74
75
  alert = @driver.find_element(:css => 'div[role="alert"]')
75
76
  begin
@@ -1,3 +1,3 @@
1
1
  module Gphotos
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gphotos
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhong Jianxin
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-20 00:00:00.000000000 Z
11
+ date: 2017-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler