Skip to content

Commit

Permalink
Revert "feat: 先注释掉pipline"
Browse files Browse the repository at this point in the history
This reverts commit c0714f4.
  • Loading branch information
wulei05 committed Aug 6, 2024
1 parent 439e2d0 commit ee9569c
Showing 1 changed file with 38 additions and 38 deletions.
76 changes: 38 additions & 38 deletions NLiteAVDemo-Android-Java/workflow/config_stub.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# import re
# import sys
# import os
#
# APP_CONFIG_FILE = sys.argv[1]
# APP_KEY = sys.argv[2]
# BASE_URL = sys.argv[3]
#
#
# # Stub a string with a evironment variable
# def stubString(searchPattern, rejectPattern, searchtText, replacement, desc):
# searchRet = re.search(searchPattern, searchtText).group()
# if re.search("\"{}\"".format(rejectPattern), searchRet) is not None:
# print
# "A valid {} is submitted!".format(desc)
# sys.exit(1)
#
# # Stub valid key and write back
# ret = re.sub('\"\S+\"', "\"{}\"".format(replacement), searchRet)
# ret = re.sub(searchPattern, ret, searchtText)
# return ret
#
#
# # Read heaer file
#
# io = open(APP_CONFIG_FILE, "r+")
# text = io.read()
#
# ret = stubString("std::string\sappKey\s?=\s?\"\S*\";", "^[a-f0-9]{32}$", text, APP_KEY, 'APP_KEY')
# ret = stubString("std::string\sbaseURL\s?=\s?\"\S*\";",
# "(?:rtmp:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+", ret,
# BASE_URL, 'BASE_URL')
#
# io.seek(0)
# io.write(ret)
# io.truncate()
#
# io.close()
import re
import sys
import os

APP_CONFIG_FILE = sys.argv[1]
APP_KEY = sys.argv[2]
BASE_URL = sys.argv[3]


# Stub a string with a evironment variable
def stubString(searchPattern, rejectPattern, searchtText, replacement, desc):
searchRet = re.search(searchPattern, searchtText).group()
if re.search("\"{}\"".format(rejectPattern), searchRet) is not None:
print
"A valid {} is submitted!".format(desc)
sys.exit(1)

# Stub valid key and write back
ret = re.sub('\"\S+\"', "\"{}\"".format(replacement), searchRet)
ret = re.sub(searchPattern, ret, searchtText)
return ret


# Read heaer file

io = open(APP_CONFIG_FILE, "r+")
text = io.read()

ret = stubString("std::string\sappKey\s?=\s?\"\S*\";", "^[a-f0-9]{32}$", text, APP_KEY, 'APP_KEY')
ret = stubString("std::string\sbaseURL\s?=\s?\"\S*\";",
"(?:rtmp:\/\/)[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+", ret,
BASE_URL, 'BASE_URL')

io.seek(0)
io.write(ret)
io.truncate()

io.close()

0 comments on commit ee9569c

Please sign in to comment.