'''
from __future__ import print_function
-import base64, os, StringIO, zipfile
+from future import standard_library
+standard_library.install_aliases()
+import base64, os, io, zipfile
def initialize(joy_home):
def create_data(from_dir='./default_joy_home'):
- f = StringIO.StringIO()
+ f = io.StringIO()
z = zipfile.ZipFile(f, mode='w')
for fn in os.listdir(from_dir):
from_fn = os.path.join(from_dir, fn)
return base64.encodestring(f.getvalue())
-Z = zipfile.ZipFile(StringIO.StringIO(base64.decodestring('''\
+Z = zipfile.ZipFile(io.StringIO(base64.decodestring('''\
UEsDBBQAAAAAAJKh9Uw/yHAgFQQAABUEAAALAAAAc2NyYXRjaC50eHRyZXNldF9sb2cgd29yZHMg
bW91c2VfYmluZGluZ3Mga2V5X2JpbmRpbmdzCgpTdGFjayBDaGF0dGVyCgogZHVwIGR1cGQgZHVw
ZGQgb3ZlciB0dWNrCiBwb3AgcG9wZCBwb3BkZCBwb3BvcCBwb3BvcGQgcG9wb3BkZAogc3dhcCBy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
+from future import standard_library
+standard_library.install_aliases()
('''\
Joypy - Copyright © 2018 Simon Forman
'''
' Right-click on these commands to see docs on UI commands: key_bindings mouse_bindings')
import logging, os, pickle, sys
from textwrap import dedent
-from ConfigParser import RawConfigParser
+from configparser import RawConfigParser
from joy.gui.utils import init_home, argparser, FileFaker
'F4 - Paste item on top of stack to insertion cursor.',
'Shift-F4 - Pop and paste top of stack to insertion cursor.',
]
- for key, command in GLOBAL_COMMANDS.iteritems():
+ for key, command in GLOBAL_COMMANDS.items():
commands.append('%s - %s' % (key.lstrip('<').rstrip('>'), command))
print('\n'.join([''] + sorted(commands)))
return args
#Do-nothing event handler.
+from builtins import object
nothing = lambda event: None
-class MouseBindingsMixin:
+class MouseBindingsMixin(object):
"""TextViewerWidget mixin class to provide mouse bindings."""
def __init__(self):
'''
from __future__ import print_function
+from future import standard_library
+standard_library.install_aliases()
+from builtins import str, map, object
+from past.builtins import basestring
try:
import tkinter as tk
from tkinter.font import families, Font
}
-class SavingMixin:
+class SavingMixin(object):
def __init__(self, saver=None, filename=None, save_delay=2000):
self.saver = self._saver if saver is None else saver
from __future__ import print_function
+from builtins import object
import argparse, os, sys
from os import listdir, mkdir
from os.path import abspath, exists, expanduser, isfile, join
# along with joy.py. If not see <http://www.gnu.org/licenses/>.
#
from __future__ import print_function
+from builtins import object
from logging import getLogger
_log = getLogger(__name__)