# Path: gsdview/utils.py
# def default_workdir():
# def _getresource(resource, package):
# def getresource(resource, package=None):
# def format_platform_info():
# def format_bugreport(exctype=None, excvalue=None, tracebackobj=None,
#                      extra_info=None):
#     def isexecutable(cmd):
#     def isexecutable(cmd):
# def isscript(filename):
# def scriptcmd(scriptname):
#     def get_tree_size(path):
#     def get_tree_size(path):
# def data_uuid(path, prefixlen=23):
# def geonormalize(x, angle_range=360.):


import os
import csv
import math
import logging
        import qtpy
import numpy as np
from io import StringIO
from configparser import ConfigParser
from qtpy import QtCore, QtWidgets, QtGui, QtSvg, QtPrintSupport, uic
from gsdview import utils
        from io import StringIO
        from xml.etree.ElementTree import ElementTree
        from qtpy import QtWidgets
            from pyside2uic import compileUi
            from pysideuic import compileUi
        try:
            parent = obj.window()
        except AttributeError:
            parent = None

    # dialog = QtPrintSupport.QPrintDialog(printer)
    # try:
    #     window = obj.window()
    # except AttributeError:
    #     window = = None
    # preview = QtWidgets.QPrintPreviewWidget(printer, window)
    # preview.paintRequested.connect(coreprint)
    # dialog.setOptionTabs([preview])
    # ret = d.exec_()

    ret = QtPrintSupport.QPrintDialog(printer, parent).exec_()
    if ret == QtWidgets.QDialog.Accepted:
        if isinstance(obj, (QtGui.QTextDocument, QtWidgets.QTextEdit)):
            obj.print_(printer)
        elif hasattr(obj, 'model'):
            model = obj.model()
            doc = modelToTextDocument(model)
            doc.print_(printer)
        elif isinstance(obj, QtCore.QAbstractItemModel):
            doc = modelToTextDocument(obj)
            doc.print_(printer)
        else:
            coreprint(obj, printer)



# Path: gsdview/utils.py
# def default_workdir():
# def _getresource(resource, package):
# def getresource(resource, package=None):
# def format_platform_info():
# def format_bugreport(exctype=None, excvalue=None, tracebackobj=None,
#                      extra_info=None):
#     def isexecutable(cmd):
#     def isexecutable(cmd):
# def isscript(filename):
# def scriptcmd(scriptname):
#     def get_tree_size(path):
#     def get_tree_size(path):
# def data_uuid(path, prefixlen=23):
# def geonormalize(x, angle_range=360.):


# Path: gsdview/qtsupport.py
import os
import csv
import math
import logging
        import qtpy
import numpy as np
from io import StringIO
from configparser import ConfigParser
from qtpy import QtCore, QtWidgets, QtGui, QtSvg, QtPrintSupport, uic
from gsdview import utils
        from io import StringIO
        from xml.etree.ElementTree import ElementTree
        from qtpy import QtWidgets
            from pyside2uic import compileUi
            from pysideuic import compileUi

        try:
            parent = obj.window()
        except AttributeError:
            parent = None

    # dialog = QtPrintSupport.QPrintDialog(printer)
    # try:
    #     window = obj.window()
    # except AttributeError:
    #     window = = None
    # preview = QtWidgets.QPrintPreviewWidget(printer, window)
    # preview.paintRequested.connect(coreprint)
    # dialog.setOptionTabs([preview])
    # ret = d.exec_()

    ret = QtPrintSupport.QPrintDialog(printer, parent).exec_()
    if ret == QtWidgets.QDialog.Accepted:
        if isinstance(obj, (QtGui.QTextDocument, QtWidgets.QTextEdit)):
            obj.print_(printer)
        elif hasattr(obj, 'model'):
            model = obj.model()
            doc = modelToTextDocument(model)
            doc.print_(printer)
        elif isinstance(obj, QtCore.QAbstractItemModel):
            doc = modelToTextDocument(obj)
            doc.print_(printer)
        else:
            coreprint(obj, printer)



def printPreview(obj, printer=None, parent=None):