Merge branch 'master' into feat/x11/clipboard-file/init

This commit is contained in:
RustDesk 2023-10-30 14:57:36 +08:00 committed by GitHub
commit a3b06ee83f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 73 additions and 72 deletions

View file

@ -204,11 +204,9 @@ def download_extract_features(features, res_dir):
return r return r
for (feat, feat_info) in features.items(): for (feat, feat_info) in features.items():
includes = feat_info['include'] if 'include' in feat_info and feat_info['include'] else [ includes = feat_info['include'] if 'include' in feat_info and feat_info['include'] else []
]
includes = [re.compile(p) for p in includes] includes = [re.compile(p) for p in includes]
excludes = feat_info['exclude'] if 'exclude' in feat_info and feat_info['exclude'] else [ excludes = feat_info['exclude'] if 'exclude' in feat_info and feat_info['exclude'] else []
]
excludes = [re.compile(p) for p in excludes] excludes = [re.compile(p) for p in excludes]
print(f'{feat} download begin') print(f'{feat} download begin')
@ -594,7 +592,7 @@ def main():
else: else:
print('Not signed') print('Not signed')
else: else:
# buid deb package # build deb package
system2( system2(
'mv target/release/bundle/deb/rustdesk*.deb ./rustdesk.deb') 'mv target/release/bundle/deb/rustdesk*.deb ./rustdesk.deb')
system2('dpkg-deb -R rustdesk.deb tmpdeb') system2('dpkg-deb -R rustdesk.deb tmpdeb')

View file

@ -1,4 +1,3 @@
from ast import parse
import os import os
import optparse import optparse
from hashlib import md5 from hashlib import md5
@ -47,7 +46,7 @@ def write_metadata(md5_table: dict, output_folder: str, exe: str):
f.write((len(path)).to_bytes(length=length_count, byteorder='big')) f.write((len(path)).to_bytes(length=length_count, byteorder='big'))
f.write(path) f.write(path)
# data length & compressed data # data length & compressed data
f.write((data_length).to_bytes( f.write(data_length.to_bytes(
length=length_count, byteorder='big')) length=length_count, byteorder='big'))
f.write(compressed_data) f.write(compressed_data)
# md5 code # md5 code
@ -65,6 +64,8 @@ def build_portable(output_folder: str):
# Linux: python3 generate.py -f ../rustdesk-portable-packer/test -o . -e ./test/main.py # Linux: python3 generate.py -f ../rustdesk-portable-packer/test -o . -e ./test/main.py
# Windows: python3 .\generate.py -f ..\rustdesk\flutter\build\windows\runner\Debug\ -o . -e ..\rustdesk\flutter\build\windows\runner\Debug\rustdesk.exe # Windows: python3 .\generate.py -f ..\rustdesk\flutter\build\windows\runner\Debug\ -o . -e ..\rustdesk\flutter\build\windows\runner\Debug\rustdesk.exe
if __name__ == '__main__': if __name__ == '__main__':
parser = optparse.OptionParser() parser = optparse.OptionParser()
parser.add_option("-f", "--folder", dest="folder", parser.add_option("-f", "--folder", dest="folder",

View file

@ -5,20 +5,22 @@ import glob
import sys import sys
import csv import csv
def get_lang(lang): def get_lang(lang):
out = {} out = {}
for ln in open('./src/lang/%s.rs'%lang, encoding='utf8'): for ln in open('./src/lang/%s.rs' % lang, encoding='utf8'):
ln = ln.strip() ln = ln.strip()
if ln.startswith('("'): if ln.startswith('("'):
k, v = line_split(ln) k, v = line_split(ln)
out[k] = v out[k] = v
return out return out
def line_split(line): def line_split(line):
toks = line.split('", "') toks = line.split('", "')
if len(toks) != 2: if len(toks) != 2:
print(line) print(line)
assert(0) assert 0
# Replace fixed position. # Replace fixed position.
# Because toks[1] may be v") or v"), # Because toks[1] may be v") or v"),
k = toks[0][toks[0].find('"') + 1:] k = toks[0][toks[0].find('"') + 1:]
@ -27,62 +29,62 @@ def line_split(line):
def main(): def main():
if len(sys.argv) == 1: if len(sys.argv) == 1:
expand() expand()
elif sys.argv[1] == '1': elif sys.argv[1] == '1':
to_csv() to_csv()
else: else:
to_rs(sys.argv[1]) to_rs(sys.argv[1])
def expand(): def expand():
for fn in glob.glob('./src/lang/*.rs'): for fn in glob.glob('./src/lang/*.rs'):
lang = os.path.basename(fn)[:-3] lang = os.path.basename(fn)[:-3]
if lang in ['en','template']: continue if lang in ['en', 'template']: continue
print(lang) print(lang)
dict = get_lang(lang) dict = get_lang(lang)
fw = open("./src/lang/%s.rs"%lang, "wt", encoding='utf8') fw = open("./src/lang/%s.rs" % lang, "wt", encoding='utf8')
for line in open('./src/lang/template.rs', encoding='utf8'): for line in open('./src/lang/template.rs', encoding='utf8'):
line_strip = line.strip() line_strip = line.strip()
if line_strip.startswith('("'): if line_strip.startswith('("'):
k, v = line_split(line_strip) k, v = line_split(line_strip)
if k in dict: if k in dict:
# embraced with " to avoid empty v # embraced with " to avoid empty v
line = line.replace('"%s"'%v, '"%s"'%dict[k]) line = line.replace('"%s"' % v, '"%s"' % dict[k])
else: else:
line = line.replace(v, "") line = line.replace(v, "")
fw.write(line) fw.write(line)
else: else:
fw.write(line) fw.write(line)
fw.close() fw.close()
def to_csv(): def to_csv():
for fn in glob.glob('./src/lang/*.rs'): for fn in glob.glob('./src/lang/*.rs'):
lang = os.path.basename(fn)[:-3] lang = os.path.basename(fn)[:-3]
csvfile = open('./src/lang/%s.csv'%lang, "wt", encoding='utf8') csvfile = open('./src/lang/%s.csv' % lang, "wt", encoding='utf8')
csvwriter = csv.writer(csvfile) csvwriter = csv.writer(csvfile)
for line in open(fn, encoding='utf8'): for line in open(fn, encoding='utf8'):
line_strip = line.strip() line_strip = line.strip()
if line_strip.startswith('("'): if line_strip.startswith('("'):
k, v = line_split(line_strip) k, v = line_split(line_strip)
csvwriter.writerow([k, v]) csvwriter.writerow([k, v])
csvfile.close() csvfile.close()
def to_rs(lang): def to_rs(lang):
csvfile = open('%s.csv'%lang, "rt", encoding='utf8') csvfile = open('%s.csv' % lang, "rt", encoding='utf8')
fw = open("./src/lang/%s.rs"%lang, "wt", encoding='utf8') fw = open("./src/lang/%s.rs" % lang, "wt", encoding='utf8')
fw.write('''lazy_static::lazy_static! { fw.write('''lazy_static::lazy_static! {
pub static ref T: std::collections::HashMap<&'static str, &'static str> = pub static ref T: std::collections::HashMap<&'static str, &'static str> =
[ [
''') ''')
for row in csv.reader(csvfile): for row in csv.reader(csvfile):
fw.write(' ("%s", "%s"),\n'%(row[0].replace('"', '\"'), row[1].replace('"', '\"'))) fw.write(' ("%s", "%s"),\n' % (row[0].replace('"', '\"'), row[1].replace('"', '\"')))
fw.write(''' ].iter().cloned().collect(); fw.write(''' ].iter().cloned().collect();
} }
''') ''')
fw.close() fw.close()
main() main()

View file

@ -570,7 +570,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Big tiles", "Große Kacheln"), ("Big tiles", "Große Kacheln"),
("Small tiles", "Kleine Kacheln"), ("Small tiles", "Kleine Kacheln"),
("List", "Liste"), ("List", "Liste"),
("Virtual display", ""), ("Virtual display", "Virtueller Bildschirm"),
("Plug out all", ""), ("Plug out all", "Alle ausschalten"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View file

@ -570,7 +570,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Big tiles", "Icone grandi"), ("Big tiles", "Icone grandi"),
("Small tiles", "Icone piccole"), ("Small tiles", "Icone piccole"),
("List", "Elenco"), ("List", "Elenco"),
("Virtual display", ""), ("Virtual display", "Scehrmo virtuale"),
("Plug out all", ""), ("Plug out all", "Scollega tutto"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View file

@ -274,7 +274,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Chat", "Czat"), ("Chat", "Czat"),
("Total", "Łącznie"), ("Total", "Łącznie"),
("items", "elementów"), ("items", "elementów"),
("Selected", "Zaznaczonych"), ("Selected", "zaznaczonych"),
("Screen Capture", "Przechwytywanie ekranu"), ("Screen Capture", "Przechwytywanie ekranu"),
("Input Control", "Kontrola wejścia"), ("Input Control", "Kontrola wejścia"),
("Audio Capture", "Przechwytywanie dźwięku"), ("Audio Capture", "Przechwytywanie dźwięku"),
@ -564,13 +564,13 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("elevated_switch_display_msg", "Przełącz się na ekran główny, ponieważ wyświetlanie kilku ekranów nie jest obsługiwane przy podniesionych uprawnieniach."), ("elevated_switch_display_msg", "Przełącz się na ekran główny, ponieważ wyświetlanie kilku ekranów nie jest obsługiwane przy podniesionych uprawnieniach."),
("Open in new window", "Otwórz w nowym oknie"), ("Open in new window", "Otwórz w nowym oknie"),
("Show displays as individual windows", "Pokaż ekrany w osobnych oknach"), ("Show displays as individual windows", "Pokaż ekrany w osobnych oknach"),
("Use all my displays for the remote session", ""), ("Use all my displays for the remote session", "Użyj wszystkich moich ekranów do zdalnej sesji"),
("selinux_tip", ""), ("selinux_tip", "SELinux jest włączony na Twoim urządzeniu, co może przeszkodzić w uruchomieniu RustDesk po stronie kontrolowanej."),
("Change view", ""), ("Change view", "Zmień widok"),
("Big tiles", ""), ("Big tiles", "Duże kafelki"),
("Small tiles", ""), ("Small tiles", "Małe kafelki"),
("List", ""), ("List", "Lista"),
("Virtual display", ""), ("Virtual display", "Witualne ekrany"),
("Plug out all", ""), ("Plug out all", "Odłącz wszystko"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }

View file

@ -570,7 +570,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Big tiles", "Большие значки"), ("Big tiles", "Большие значки"),
("Small tiles", "Маленькие значки"), ("Small tiles", "Маленькие значки"),
("List", "Список"), ("List", "Список"),
("Virtual display", ""), ("Virtual display", "Виртуальный дисплей"),
("Plug out all", ""), ("Plug out all", "Отключить все"),
].iter().cloned().collect(); ].iter().cloned().collect();
} }