Skip to content

Commit

Permalink
fixed (I hope) config handle
Browse files Browse the repository at this point in the history
  • Loading branch information
janinainfa committed Jul 9, 2024
1 parent 85444d5 commit 1b7ce2f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 33 deletions.
26 changes: 15 additions & 11 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions ...package/home/user/mexassistant/config.ini → create_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
[DEFAULT]
import os

homeDir = os.path.expanduser("~")


configContent = '''[DEFAULT]
voice_lang = pl-PL
[otwórz terminal]
Expand Down Expand Up @@ -29,5 +34,15 @@
[następna piosenka]
type = terminal
command = playerctl next
command = playerctl next'''

def createConfig():
try:
os.mkdir(homeDir + "/mexassistant")
except:
pass
finally:
with open(homeDir + "/mexassistant/config.ini", 'w') as f:
f.write(configContent)


20 changes: 0 additions & 20 deletions deb-package/DEBIAN/postint

This file was deleted.

6 changes: 6 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import main_window
import process_command as pc
import os
import create_config

if __name__ == "__main__":
print("Uruchamianie...")
try:
open(os.path.expanduser("~") + "/mexassistant/config.ini")
except:
create_config.createConfig()
commandProcessing = pc.CommandProcessing()
main_window.buildApp(commandProcessing)

0 comments on commit 1b7ce2f

Please sign in to comment.