Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
LexiconCode committed Aug 20, 2019
1 parent 783b8eb commit 0ba75e1
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion castervoice/lib/github_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import traceback
from __builtin__ import True
from subprocess import Popen, PIPE
import toml
import tomlkit
import time

from castervoice.lib.actions import Key, Text
Expand Down
12 changes: 6 additions & 6 deletions castervoice/lib/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import io
import os
import sys
import toml
import tomlkit
import _winreg
import version
import errno
Expand Down Expand Up @@ -153,15 +153,15 @@ def _validate_engine_path():
return ''
if os.path.isfile(_SETTINGS_PATH):
with io.open(_SETTINGS_PATH, "rt", encoding="utf-8") as toml_file:
data = toml.loads(toml_file.read())
data = tomlkit.loads(toml_file.read())
engine_path = data["paths"]["ENGINE_PATH"]
if os.path.isfile(engine_path):
return engine_path
else:
engine_path = _find_natspeak()
data["paths"]["ENGINE_PATH"] = engine_path
try:
formatted_data = unicode(toml.dumps(data))
formatted_data = unicode(tomlkit.dumps(data))
with io.open(_SETTINGS_PATH, "w", encoding="utf-8") as toml_file:
toml_file.write(formatted_data)
print("Setting engine path to " + engine_path)
Expand Down Expand Up @@ -418,7 +418,7 @@ def _find_natspeak():
def _save(data, path):
'''only to be used for settings file'''
try:
formatted_data = unicode(toml.dumps(data))
formatted_data = unicode(tomlkit.dumps(data))
with io.open(path, "wt", encoding="utf-8") as f:
f.write(formatted_data)
except Exception as e:
Expand All @@ -429,7 +429,7 @@ def _init(path):
result = {}
try:
with io.open(path, "rt", encoding="utf-8") as f:
result = toml.loads(f.read())
result = tomlkit.loads(f.read())
except ValueError as e:
print("\n\n" + repr(e) + " while loading settings file: " + path + "\n\n")
print(sys.exc_info())
Expand All @@ -445,7 +445,7 @@ def _init(path):
new_path = old_clipboard[:-4] + "json"
print("\n\n Migrating clipboard from {} to {}".format(old_clipboard, new_path))
with io.open(old_clipboard, "rt", encoding="utf-8") as f:
clipboard = toml.loads(f.read())
clipboard = tomlkit.loads(f.read())
formatted_data = unicode(json.dumps(clipboard, ensure_ascii=False))
with io.open(new_path, "wt", encoding="utf-8") as f:
f.write(formatted_data)
Expand Down
6 changes: 3 additions & 3 deletions castervoice/lib/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import traceback
from __builtin__ import True
from subprocess import Popen
import toml
import tomlkit

import win32gui
import win32ui
Expand Down Expand Up @@ -104,7 +104,7 @@ def get_window_title_info():

def save_toml_file(data, path):
try:
formatted_data = unicode(toml.dumps(data))
formatted_data = unicode(tomlkit.dumps(data))
with io.open(path, "wt", encoding="utf-8") as f:
f.write(formatted_data)
except Exception:
Expand All @@ -115,7 +115,7 @@ def load_toml_file(path):
result = {}
try:
with io.open(path, "rt", encoding="utf-8") as f:
result = toml.loads(f.read())
result = tomlkit.loads(f.read())
except IOError as e:
if e.errno == 2: # The file doesn't exist.
save_toml_file(result, path)
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dragonfly2==0.16.0
wxpython==4.0.4
pillow==5.3.0
toml==0.10.0
tomlkit==0.5.5
future==0.17.1
mock==3.0.5
pylint==1.9.3
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dragonfly2==0.16.0
wxpython==4.0.4
pillow==5.3.0
toml==0.10.0
tomlkit==0.5.5
future==0.17.1
mock==3.0.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run(self):
"dragonfly2>=0.14.1",
"wxpython",
"pillow",
"toml",
"tomlkit",
"future",
"mock",
],
Expand Down

0 comments on commit 0ba75e1

Please sign in to comment.