cocoapods-localzedLoader 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-localzedLoader/DownloadNewLanguage.py +6 -6
- data/lib/cocoapods-localzedLoader/command/localzedLoader.rb +13 -2
- data/lib/cocoapods-localzedLoader/gem_version.rb +1 -1
- data/lib/cocoapods-localzedLoader/ios_bundle_generate.rb +3 -4
- data/lib/cocoapods_plugin.rb +2 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e9a8c842b35fcb5d5f5a39ddaccb02d3b1f0592cf01ac968903a23422bb083b
|
4
|
+
data.tar.gz: 00b207c172bf1c6168d9ec8d32832f2d7b9bbc1ad2cef09ff2a2dc7c3f9ae9a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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('成功
|
76
|
-
with open("download
|
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
|
-
|
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
|
-
|
33
|
-
BundleGenerater.generate
|
43
|
+
UI.puts "项目路径 #{@project_directory}"
|
44
|
+
BundleGenerater.generate(@project_directory)
|
34
45
|
end
|
35
46
|
end
|
36
47
|
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
|
-
|
13
|
-
|
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到内存
|
data/lib/cocoapods_plugin.rb
CHANGED
@@ -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
|
-
|
6
|
-
|
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.
|
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-
|
11
|
+
date: 2023-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|