cocoapods-localzedLoader 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fed1b44343a6d63fe148dd231f5782464954364489c2a92c7667e48e310b143
4
- data.tar.gz: 90d050c4ac0aa2141f3739df71a785f537089cd564cc40cb2f30c70c892e3b57
3
+ metadata.gz: 5e9a8c842b35fcb5d5f5a39ddaccb02d3b1f0592cf01ac968903a23422bb083b
4
+ data.tar.gz: 00b207c172bf1c6168d9ec8d32832f2d7b9bbc1ad2cef09ff2a2dc7c3f9ae9a6
5
5
  SHA512:
6
- metadata.gz: dccbe4da2724dbc16c107d6fb15a3e5ad47a6e2b677f77ab9ebb373aec2ff50cb9fce0c8141450789a142e0856fa0a2002e86d9d98caeffaefd46a7a4dff7350
7
- data.tar.gz: 79fa8e281c62d6fea5388be518caae1c8d6bdfaad4f3908fa9bce6f75ee77281831a78fc79d4802d9b1111a59af36a50d3fa484bfd3dae606e8ecdbec30ae9bb
6
+ metadata.gz: 38072dab94a7cc3df25debddb559db40e01721512496da6acbbb2b713527f8e7e1176d7f60ffaa5ba2b60cd8356d66d89d9c54e1f5f6d3fd728694b57d6b11b9
7
+ data.tar.gz: a02e2708566bf93d81222d0de77a2ccd05b22ad92f87e03599e9bb4e65c5c15cc5e17af9d30f4df83ac24c3ef4a4f978a36bed441edbeae6dea04701a3b4171d
@@ -1,6 +1,5 @@
1
- import os
2
1
  import shutil
3
-
2
+ import os, sys, stat
4
3
  import requests
5
4
  # import zipfile
6
5
 
@@ -48,7 +47,7 @@ def MakeHeader(headerText):
48
47
  s = {x.split(':', 1)[0].strip() :x.split(':', 1)[1].strip() for x in s}
49
48
  return s
50
49
 
51
- def DownLatestLocalizableSource():
50
+ def DownLatestLocalizableSource(downloadPath):
52
51
  iam_service = IamService()
53
52
  ak = 'AKLTZTFjNzFjYTczMzJjNGQyMjg0NTRkZjQ2ZTA4MTE1Mjc'
54
53
  sk = 'TkdRMU9HSTJZemt6Tmpkak5ERXhaVGt5WXpVNU5qSmxPVFkzWWpBM1pqRQ=='
@@ -72,8 +71,8 @@ def DownLatestLocalizableSource():
72
71
  resp = iam_service.session.get(url, headers=r.headers,
73
72
  timeout=(service_info.connection_timeout,service_info.socket_timeout))
74
73
  if resp.status_code == 200:
75
- print('成功l----')
76
- with open("download" + ".xlsx", "wb") as code:
74
+ print('下载exccel成功')
75
+ with open(downloadPath+"/download.xlsx", "wb") as code:
77
76
  # 将 response 保存成本地文件
78
77
  code.write(resp.content)
79
78
  code.close()
@@ -99,4 +98,5 @@ def UpdateSource_language():
99
98
  # os.remove('./download.xlsx')
100
99
 
101
100
  if __name__ == '__main__':
102
- UpdateSource_language()
101
+ localizable_path = sys.argv[1]
102
+ DownLatestLocalizableSource(localizable_path)
@@ -28,9 +28,20 @@ module Pod
28
28
 
29
29
  self.arguments = []
30
30
 
31
+ def initialize(argv)
32
+ super
33
+ project_directory = argv.option('project-directory')
34
+ project_directory = Dir.pwd if project_directory.nil?
35
+ @project_directory = Pathname.new(project_directory).expand_path
36
+ end
37
+ def self.options
38
+ [
39
+ ['--project-directory=/project/dir/', 'The path to the root of the project directory']
40
+ ].concat(super)
41
+ end
31
42
  def run
32
- # UI.puts "Add your implementation for the cocoapods-LangDownnloader plugin in #{__FILE__}"
33
- BundleGenerater.generate
43
+ UI.puts "项目路径 #{@project_directory}"
44
+ BundleGenerater.generate(@project_directory)
34
45
  end
35
46
  end
36
47
  end
@@ -1,3 +1,3 @@
1
1
  module CocoapodsLocalzedloader
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -7,11 +7,10 @@ class BundleGenerater
7
7
 
8
8
  # INFO_PLIST_ARRAY = [NSAppleMusicUsageDescription","NSLocalNetworkUsageDescription"]
9
9
  INFO_PLIST_MAP = {:common_app_name=>["CFBundleDisplayName"],other_perm_camera_permission_description:["NSCameraUsageDescription"],other_perm_location_permission_description:["NSLocationAlwaysAndWhenInUseUsageDescription","NSLocationWhenInUseUsageDescription","NSLocationAlwaysUsageDescription"],other_perm_bluetooth_permission_description:["NSBluetoothPeripheralUsageDescription","NSBluetoothAlwaysUsageDescription"],access_content_permssion_storage:["NSPhotoLibraryUsageDescription"],other_perm_mic_permission_description:["NSMicrophoneUsageDescription"],other_set_permissions_homedata_desc:["NSHomeKitUsageDescription"],other_set_permissions_asr_text:["NSSpeechRecognitionUsageDescription"],device_add_device:["Add_Device_Title"],automation_add:["Add_Automation_Title"],device_create_scene:["Add_Scene_Title"]}
10
- def self.generate
10
+ def self.generate(project_path)
11
11
  # 下载excel
12
- puts __FILE__
13
- system "cd #{File.dirname(__FILE__)};python3 DownloadNewLanguage.py"
14
- f_path = "#{File.dirname(__FILE__)}/download.xlsx"
12
+ system "cd #{File.dirname(__FILE__)};python3 DownloadNewLanguage.py #{project_path}"
13
+ f_path = "#{project_path}/download.xlsx"
15
14
  print(f_path)
16
15
 
17
16
  # 读取excel到内存
@@ -2,9 +2,7 @@ require 'cocoapods-localzedLoader/command'
2
2
  require_relative 'cocoapods-localzedLoader/ios_bundle_generate'
3
3
  module CocoapodsGitHooks
4
4
  Pod::HooksManager.register('cocoapods-localzedLoader', :pre_install) do |context|
5
- BundleGenerater.generate
6
- end
7
- Pod::HooksManager.register('cocoapods-localzedLoader', :pre_update) do |context|
8
- BundleGenerater.generate
5
+ args = ['gen', "--project-directory=#{Config.instance.installation_root}"]
6
+ Localzedloader::Command.run(args)
9
7
  end
10
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-localzedLoader
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - jeremylu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-19 00:00:00.000000000 Z
11
+ date: 2023-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty