Skip to content

Commit fe8ed2b

Browse files
committed
Remove use of six
This wasn't added to the pip deps
1 parent fa7df08 commit fe8ed2b

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

preditor/gui/drag_tab_bar.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
from functools import partial
55
from pathlib import Path
66

7-
import six
87
from Qt.QtCore import QByteArray, QMimeData, QPoint, QRect, Qt
98
from Qt.QtGui import QColor, QCursor, QDrag, QPixmap, QRegion
109
from Qt.QtWidgets import (
@@ -513,7 +512,7 @@ def save_and_link_file(self, workbox):
513512
filename = workbox.__filename__()
514513
if filename and Path(filename).is_file():
515514
workbox.__set_file_monitoring_enabled__(False)
516-
directory = six.text_type(Path(filename).parent) if filename else ""
515+
directory = str(Path(filename).parent) if filename else ""
517516
success = workbox.__save_as__(directory=directory)
518517
if not success:
519518
return

preditor/prefs.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import sys
1313
from pathlib import Path
1414

15-
import six
16-
1715
from . import resourcePath, utils
1816

1917
# cache of all the preferences
@@ -191,7 +189,7 @@ def create_stamped_path(core_name, filepath, sub_dir='workboxes', time_str=None)
191189

192190
path.parent.mkdir(exist_ok=True)
193191

194-
path = six.text_type(path)
192+
path = str(path)
195193
return path
196194

197195

@@ -284,7 +282,7 @@ def get_backup_version_info(core_name, workbox_id, versionType, backup_file=None
284282
idx += 1
285283
idx = min(idx, count - 1)
286284

287-
filepath = six.text_type(files[idx])
285+
filepath = str(files[idx])
288286
display_idx = idx + 1
289287
return filepath, display_idx, count
290288

@@ -322,7 +320,7 @@ def update_pref_args(core_name, pref_dict, old_name, update_data):
322320
orig_pref = pref_dict.pop(old_name)
323321
pref = orig_pref[:] if isinstance(orig_pref, list) else orig_pref
324322

325-
if isinstance(pref, six.text_type):
323+
if isinstance(pref, str):
326324
replacements = update_data.get("replace", [])
327325
for replacement in replacements:
328326
pref = pref.replace(*replacement)
@@ -332,11 +330,11 @@ def update_pref_args(core_name, pref_dict, old_name, update_data):
332330
newfilepath = create_stamped_path(core_name, pref)
333331
orig_filepath = workbox_dir / orig_pref
334332
if orig_filepath.is_file():
335-
orig_filepath = six.text_type(orig_filepath)
333+
orig_filepath = str(orig_filepath)
336334

337335
if not Path(newfilepath).is_file():
338336
shutil.copy(orig_filepath, newfilepath)
339-
newfilepath = six.text_type(Path(newfilepath).relative_to(workbox_dir))
337+
newfilepath = str(Path(newfilepath).relative_to(workbox_dir))
340338

341339
pref_dict.update({"backup_file": newfilepath})
342340

0 commit comments

Comments
 (0)