# Path: credits.py
# def fileVersion(program=None, year=False):
#     ver = '?'
#     ver_yr = '????'
#     if program == None:
#         check = sys.argv[0]
#     else:
#         s = program.rfind('.')
#         if s > 0 and program[s:] == '.html':
#             check = program
#         elif s < len(program) - 4:
#             check = program + sys.argv[0][sys.argv[0].rfind('.'):]
#         else:
#             check = program
#     if check[-3:] == '.py':
#         try:
#             modtime = datetime.fromtimestamp(os.path.getmtime(check))
#             ver = '3.0.%04d.%d%02d' % (modtime.year, modtime.month, modtime.day)
#             ver_yr = '%04d' % modtime.year
#         except:
#             pass
#     elif check[-5:] == '.html':
#         try:
#             modtime = datetime.fromtimestamp(os.path.getmtime(check))
#             ver = '3.0.%04d.%d%02d' % (modtime.year, modtime.month, modtime.day)
#             ver_yr = '%04d' % modtime.year
#         except:
#             pass
#     else:
#         if sys.platform == 'win32' or sys.platform == 'cygwin':
#             try:
#                 if check.find('\\') >= 0:  # if full path
#                     info = GetFileVersionInfo(check, '\\')
#                 else:
#                     info = GetFileVersionInfo(os.getcwd() + '\\' + check, '\\')
#                 ms = info['ProductVersionMS']
#               #  ls = info['FileVersionLS']
#                 ls = info['ProductVersionLS']
#                 ver = str(HIWORD(ms)) + '.' + str(LOWORD(ms)) + '.' + str(HIWORD(ls)) + '.' + str(LOWORD(ls))
#                 ver_yr = str(HIWORD(ls))
#             except:
#                 try:
#                     info = os.path.getmtime(os.getcwd() + '\\' + check)
#                     ver = '3.0.' + datetime.fromtimestamp(info).strftime('%Y.%m%d')
#                     ver_yr = datetime.fromtimestamp(info).strftime('%Y')
#                     if ver[9] == '0':
#                         ver = ver[:9] + ver[10:]
#                 except:
#                     pass
#     if year:
#         return ver_yr
#     else:
#         return ver


from urllib3 import PoolManager
from PyQt5 import QtCore, QtGui, QtWidgets
from credits import fileVersion
import math
import os
import sys
import tempfile
import configparser   # decode .ini file
import displayobject
import worldwindow
        self.progresslabel.setHidden(True)
        quit = QtWidgets.QPushButton('Quit', self)
        self.grid.addWidget(quit, 18, 0)
        quit.clicked.connect(self.quitClicked)
        QtWidgets.QShortcut(QtGui.QKeySequence('q'), self, self.quitClicked)
        query = QtWidgets.QPushButton('Query Map', self)
        wdth = query.fontMetrics().boundingRect(query.text()).width() + 9
        self.grid.addWidget(query, 18, 1)
        query.clicked.connect(self.queryClicked)
        make = QtWidgets.QPushButton('Get Map', self)
        make.setMaximumWidth(wdth)
        self.grid.addWidget(make, 18, 2)
        make.clicked.connect(self.makeClicked)
        mapquest = QtWidgets.QPushButton('MapQuest', self)
        mapquest.setMaximumWidth(wdth)
        self.grid.addWidget(mapquest, 18, 3)
        mapquest.clicked.connect(self.mapquestClicked)
        help = QtWidgets.QPushButton('Help', self)
        help.setMaximumWidth(wdth)
        self.grid.addWidget(help, 18, 4)
        help.clicked.connect(self.helpClicked)
        QtWidgets.QShortcut(QtGui.QKeySequence('F1'), self, self.helpClicked)
        frame = QtWidgets.QFrame()
        frame.setLayout(self.grid)
        self.scroll = QtWidgets.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(frame)
        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.addWidget(self.scroll)
  #      self.resize(self.width() + int(self.world_width * .7), self.height() + int(self.world_height * .7))

# Path: credits.py
# def fileVersion(program=None, year=False):
#     ver = '?'
#     ver_yr = '????'
#     if program == None:
#         check = sys.argv[0]
#     else:
#         s = program.rfind('.')
#         if s > 0 and program[s:] == '.html':
#             check = program
#         elif s < len(program) - 4:
#             check = program + sys.argv[0][sys.argv[0].rfind('.'):]
#         else:
#             check = program
#     if check[-3:] == '.py':
#         try:
#             modtime = datetime.fromtimestamp(os.path.getmtime(check))
#             ver = '3.0.%04d.%d%02d' % (modtime.year, modtime.month, modtime.day)
#             ver_yr = '%04d' % modtime.year
#         except:
#             pass
#     elif check[-5:] == '.html':
#         try:
#             modtime = datetime.fromtimestamp(os.path.getmtime(check))
#             ver = '3.0.%04d.%d%02d' % (modtime.year, modtime.month, modtime.day)
#             ver_yr = '%04d' % modtime.year
#         except:
#             pass
#     else:
#         if sys.platform == 'win32' or sys.platform == 'cygwin':
#             try:
#                 if check.find('\\') >= 0:  # if full path
#                     info = GetFileVersionInfo(check, '\\')
#                 else:
#                     info = GetFileVersionInfo(os.getcwd() + '\\' + check, '\\')
#                 ms = info['ProductVersionMS']
#               #  ls = info['FileVersionLS']
#                 ls = info['ProductVersionLS']
#                 ver = str(HIWORD(ms)) + '.' + str(LOWORD(ms)) + '.' + str(HIWORD(ls)) + '.' + str(LOWORD(ls))
#                 ver_yr = str(HIWORD(ls))
#             except:
#                 try:
#                     info = os.path.getmtime(os.getcwd() + '\\' + check)
#                     ver = '3.0.' + datetime.fromtimestamp(info).strftime('%Y.%m%d')
#                     ver_yr = datetime.fromtimestamp(info).strftime('%Y')
#                     if ver[9] == '0':
#                         ver = ver[:9] + ver[10:]
#                 except:
#                     pass
#     if year:
#         return ver_yr
#     else:
#         return ver


# Path: getmap.py
from urllib3 import PoolManager
from PyQt5 import QtCore, QtGui, QtWidgets
from credits import fileVersion
import math
import os
import sys
import tempfile
import configparser   # decode .ini file
import displayobject
import worldwindow

        self.progresslabel.setHidden(True)
        quit = QtWidgets.QPushButton('Quit', self)
        self.grid.addWidget(quit, 18, 0)
        quit.clicked.connect(self.quitClicked)
        QtWidgets.QShortcut(QtGui.QKeySequence('q'), self, self.quitClicked)
        query = QtWidgets.QPushButton('Query Map', self)
        wdth = query.fontMetrics().boundingRect(query.text()).width() + 9
        self.grid.addWidget(query, 18, 1)
        query.clicked.connect(self.queryClicked)
        make = QtWidgets.QPushButton('Get Map', self)
        make.setMaximumWidth(wdth)
        self.grid.addWidget(make, 18, 2)
        make.clicked.connect(self.makeClicked)
        mapquest = QtWidgets.QPushButton('MapQuest', self)
        mapquest.setMaximumWidth(wdth)
        self.grid.addWidget(mapquest, 18, 3)
        mapquest.clicked.connect(self.mapquestClicked)
        help = QtWidgets.QPushButton('Help', self)
        help.setMaximumWidth(wdth)
        self.grid.addWidget(help, 18, 4)
        help.clicked.connect(self.helpClicked)
        QtWidgets.QShortcut(QtGui.QKeySequence('F1'), self, self.helpClicked)
        frame = QtWidgets.QFrame()
        frame.setLayout(self.grid)
        self.scroll = QtWidgets.QScrollArea()
        self.scroll.setWidgetResizable(True)
        self.scroll.setWidget(frame)
        self.layout = QtWidgets.QVBoxLayout(self)
        self.layout.addWidget(self.scroll)
  #      self.resize(self.width() + int(self.world_width * .7), self.height() + int(self.world_height * .7))

        self.setWindowTitle('SIREN - getmap (' + fileVersion() + ") - Make Map from OSM or MapQuest")