Zufallsnamen
This commit is contained in:
parent
9daaf4bf2a
commit
0be69a4884
3 changed files with 49 additions and 36 deletions
2
.idea/MSFS_Simbrief2.iml
generated
2
.idea/MSFS_Simbrief2.iml
generated
|
|
@ -2,7 +2,7 @@
|
|||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.9" jdkType="Python SDK" />
|
||||
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
2
.idea/misc.xml
generated
2
.idea/misc.xml
generated
|
|
@ -3,5 +3,5 @@
|
|||
<component name="Black">
|
||||
<option name="sdkName" value="Python 3.13" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.13" project-jdk-type="Python SDK" />
|
||||
</project>
|
||||
|
|
@ -346,7 +346,14 @@ def BACKUP(Pfad):
|
|||
len(txt_files)
|
||||
)
|
||||
return None
|
||||
def zufName(X):
|
||||
with open("namen.json", encoding="utf-8") as f:
|
||||
data = json.load(f)
|
||||
|
||||
name = random.choice(data["Mann"])
|
||||
if X =='P':
|
||||
name = random.choice(data["Frau"])
|
||||
return name
|
||||
|
||||
host = os.getcwd()
|
||||
Pfad = os.getcwd() + '/Announcements/'
|
||||
|
|
@ -367,6 +374,10 @@ if conf_file.exists():
|
|||
)
|
||||
with open(conf_file) as file:
|
||||
passw = json.load(file)
|
||||
if passw['Prompt']['CptName'] == '':
|
||||
passw['Prompt']['CptName'] = zufName("C")
|
||||
if passw['Prompt']['PurserName'] == '':
|
||||
passw['Prompt']['PurserName'] = zufName("P")
|
||||
|
||||
else:
|
||||
#print("Keine Konfigurationsdatei vorhanden:", conf_file)
|
||||
|
|
@ -453,6 +464,8 @@ ordnerneu.mkdir(exist_ok=True)
|
|||
logging.info("--------------------------------------------------")
|
||||
logging.info("START .txt Erzeugung ")
|
||||
logging.info("--------------------------------------------------")
|
||||
debug = True
|
||||
if debug == False:
|
||||
metarCabin = METAR()
|
||||
metar = metarCabin.choices[0].message.content
|
||||
metar = "\n".join(filter(None, map(str.strip, metar.splitlines())))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue