-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from iruletheworld/2018_01_04
2018 01 04
- Loading branch information
Showing
9 changed files
with
2,090 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
# Form implementation generated from reading ui file 'main.ui' | ||
# | ||
# Created by: PyQt5 UI code generator 5.6 | ||
# | ||
# WARNING! All changes made in this file will be lost! | ||
|
||
import os | ||
|
||
from PyQt5 import QtCore, QtGui, QtWidgets | ||
|
||
class Ui_SVG2EMF(object): | ||
|
||
def setupUi(self, SVG2EMF): | ||
|
||
SVG2EMF.setObjectName("SVG2EMF") | ||
SVG2EMF.resize(470, 281) | ||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred) | ||
sizePolicy.setHorizontalStretch(0) | ||
sizePolicy.setVerticalStretch(0) | ||
sizePolicy.setHeightForWidth(SVG2EMF.sizePolicy().hasHeightForWidth()) | ||
SVG2EMF.setSizePolicy(sizePolicy) | ||
SVG2EMF.setMinimumSize(QtCore.QSize(470, 281)) | ||
SVG2EMF.setMaximumSize(QtCore.QSize(600, 400)) | ||
self.centralwidget = QtWidgets.QWidget(SVG2EMF) | ||
self.centralwidget.setObjectName("centralwidget") | ||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget) | ||
self.verticalLayout_2.setObjectName("verticalLayout_2") | ||
self.gLayout_dir = QtWidgets.QGridLayout() | ||
self.gLayout_dir.setObjectName("gLayout_dir") | ||
self.btn_browse_svg = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_browse_svg.setObjectName("btn_browse_svg") | ||
self.gLayout_dir.addWidget(self.btn_browse_svg, 1, 2, 1, 1) | ||
self.ledt_svg_dir = QtWidgets.QLineEdit(self.centralwidget) | ||
self.ledt_svg_dir.setObjectName("ledt_svg_dir") | ||
self.gLayout_dir.addWidget(self.ledt_svg_dir, 1, 1, 1, 1) | ||
self.lbl_emf_dir = QtWidgets.QLabel(self.centralwidget) | ||
font = QtGui.QFont() | ||
font.setFamily("Helvetica") | ||
font.setBold(True) | ||
font.setWeight(75) | ||
self.lbl_emf_dir.setFont(font) | ||
self.lbl_emf_dir.setObjectName("lbl_emf_dir") | ||
self.gLayout_dir.addWidget(self.lbl_emf_dir, 2, 0, 1, 1) | ||
self.lbl_svg_dir = QtWidgets.QLabel(self.centralwidget) | ||
font = QtGui.QFont() | ||
font.setFamily("Helvetica") | ||
font.setBold(True) | ||
font.setWeight(75) | ||
self.lbl_svg_dir.setFont(font) | ||
self.lbl_svg_dir.setObjectName("lbl_svg_dir") | ||
self.gLayout_dir.addWidget(self.lbl_svg_dir, 1, 0, 1, 1) | ||
self.ledt_emf_dir = QtWidgets.QLineEdit(self.centralwidget) | ||
self.ledt_emf_dir.setObjectName("ledt_emf_dir") | ||
self.gLayout_dir.addWidget(self.ledt_emf_dir, 2, 1, 1, 1) | ||
self.btn_browse_emf = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_browse_emf.setObjectName("btn_browse_emf") | ||
self.gLayout_dir.addWidget(self.btn_browse_emf, 2, 2, 1, 1) | ||
self.ledt_inkscape_dir = QtWidgets.QLineEdit(self.centralwidget) | ||
self.ledt_inkscape_dir.setObjectName("ledt_inkscape_dir") | ||
self.gLayout_dir.addWidget(self.ledt_inkscape_dir, 0, 1, 1, 1) | ||
self.lbl_inkscape_dir = QtWidgets.QLabel(self.centralwidget) | ||
font = QtGui.QFont() | ||
font.setFamily("Helvetica") | ||
font.setBold(True) | ||
font.setWeight(75) | ||
self.lbl_inkscape_dir.setFont(font) | ||
self.lbl_inkscape_dir.setObjectName("lbl_inkscape_dir") | ||
self.gLayout_dir.addWidget(self.lbl_inkscape_dir, 0, 0, 1, 1) | ||
self.btn_browse_inkscape = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_browse_inkscape.setObjectName("btn_browse_inkscape") | ||
self.gLayout_dir.addWidget(self.btn_browse_inkscape, 0, 2, 1, 1) | ||
self.verticalLayout_2.addLayout(self.gLayout_dir) | ||
self.vLayout = QtWidgets.QVBoxLayout() | ||
self.vLayout.setObjectName("vLayout") | ||
self.chkBox_openEmfOnEnd = QtWidgets.QCheckBox(self.centralwidget) | ||
font = QtGui.QFont() | ||
font.setFamily("Helvetica") | ||
font.setBold(True) | ||
font.setWeight(75) | ||
self.chkBox_openEmfOnEnd.setFont(font) | ||
self.chkBox_openEmfOnEnd.setObjectName("chkBox_openEmfOnEnd") | ||
self.vLayout.addWidget(self.chkBox_openEmfOnEnd) | ||
self.progressBar = QtWidgets.QProgressBar(self.centralwidget) | ||
font = QtGui.QFont() | ||
font.setFamily("Helvetica") | ||
font.setBold(True) | ||
font.setWeight(75) | ||
self.progressBar.setFont(font) | ||
self.progressBar.setProperty("value", 0) | ||
self.progressBar.setAlignment(QtCore.Qt.AlignCenter) | ||
self.progressBar.setObjectName("progressBar") | ||
self.vLayout.addWidget(self.progressBar) | ||
self.verticalLayout_2.addLayout(self.vLayout) | ||
self.hLayout_btn = QtWidgets.QHBoxLayout() | ||
self.hLayout_btn.setObjectName("hLayout_btn") | ||
self.btn_exit = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_exit.setStyleSheet("font: 75 9pt \"Helvetica\";") | ||
self.btn_exit.setObjectName("btn_exit") | ||
self.hLayout_btn.addWidget(self.btn_exit) | ||
self.btn_open_svg = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_open_svg.setStyleSheet("font: 75 9pt \"Helvetica\";") | ||
self.btn_open_svg.setObjectName("btn_open_svg") | ||
self.hLayout_btn.addWidget(self.btn_open_svg) | ||
self.btn_open_emf = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_open_emf.setStyleSheet("font: 75 9pt \"Helvetica\";") | ||
self.btn_open_emf.setObjectName("btn_open_emf") | ||
self.hLayout_btn.addWidget(self.btn_open_emf) | ||
self.btn_go = QtWidgets.QPushButton(self.centralwidget) | ||
self.btn_go.setStyleSheet("color: rgb(255, 0, 0);\n" | ||
"font: 75 9pt \"Helvetica\";") | ||
self.btn_go.setObjectName("btn_go") | ||
self.hLayout_btn.addWidget(self.btn_go) | ||
self.verticalLayout_2.addLayout(self.hLayout_btn) | ||
SVG2EMF.setCentralWidget(self.centralwidget) | ||
self.menubar = QtWidgets.QMenuBar(SVG2EMF) | ||
self.menubar.setGeometry(QtCore.QRect(0, 0, 470, 26)) | ||
self.menubar.setObjectName("menubar") | ||
self.menuFile = QtWidgets.QMenu(self.menubar) | ||
self.menuFile.setObjectName("menuFile") | ||
self.menuHelp = QtWidgets.QMenu(self.menubar) | ||
self.menuHelp.setObjectName("menuHelp") | ||
SVG2EMF.setMenuBar(self.menubar) | ||
self.statusbar = QtWidgets.QStatusBar(SVG2EMF) | ||
self.statusbar.setObjectName("statusbar") | ||
SVG2EMF.setStatusBar(self.statusbar) | ||
self.act_file_exit = QtWidgets.QAction(SVG2EMF) | ||
self.act_file_exit.setObjectName("act_file_exit") | ||
self.act_help_doct = QtWidgets.QAction(SVG2EMF) | ||
self.act_help_doct.setObjectName("act_help_doct") | ||
self.act_help_about = QtWidgets.QAction(SVG2EMF) | ||
self.act_help_about.setObjectName("act_help_about") | ||
self.act_file_go = QtWidgets.QAction(SVG2EMF) | ||
self.act_file_go.setObjectName("act_file_go") | ||
self.menuFile.addAction(self.act_file_go) | ||
self.menuFile.addAction(self.act_file_exit) | ||
self.menuHelp.addAction(self.act_help_doct) | ||
self.menuHelp.addAction(self.act_help_about) | ||
self.menubar.addAction(self.menuFile.menuAction()) | ||
self.menubar.addAction(self.menuHelp.menuAction()) | ||
|
||
self.retranslateUi(SVG2EMF) | ||
self.act_file_exit.triggered['bool'].connect(SVG2EMF.close) | ||
self.btn_exit.clicked['bool'].connect(SVG2EMF.close) | ||
QtCore.QMetaObject.connectSlotsByName(SVG2EMF) | ||
SVG2EMF.setTabOrder(self.ledt_inkscape_dir, self.btn_browse_inkscape) | ||
SVG2EMF.setTabOrder(self.btn_browse_inkscape, self.ledt_svg_dir) | ||
SVG2EMF.setTabOrder(self.ledt_svg_dir, self.btn_browse_svg) | ||
SVG2EMF.setTabOrder(self.btn_browse_svg, self.ledt_emf_dir) | ||
SVG2EMF.setTabOrder(self.ledt_emf_dir, self.btn_browse_emf) | ||
SVG2EMF.setTabOrder(self.btn_browse_emf, self.btn_go) | ||
SVG2EMF.setTabOrder(self.btn_go, self.btn_open_emf) | ||
SVG2EMF.setTabOrder(self.btn_open_emf, self.btn_open_svg) | ||
SVG2EMF.setTabOrder(self.btn_open_svg, self.btn_exit) | ||
|
||
def retranslateUi(self, SVG2EMF): | ||
_translate = QtCore.QCoreApplication.translate | ||
SVG2EMF.setWindowTitle(_translate("SVG2EMF", "SVG2EMF")) | ||
self.btn_browse_svg.setText(_translate("SVG2EMF", "Browse")) | ||
self.lbl_emf_dir.setText(_translate("SVG2EMF", "<html><head/><body><p>EMF folder</p></body></html>")) | ||
self.lbl_svg_dir.setText(_translate("SVG2EMF", "<html><head/><body><p>SVG folder</p></body></html>")) | ||
self.btn_browse_emf.setText(_translate("SVG2EMF", "Browse")) | ||
self.lbl_inkscape_dir.setText(_translate("SVG2EMF", "<html><head/><body><p>Inkscape folder</p></body></html>")) | ||
self.btn_browse_inkscape.setText(_translate("SVG2EMF", "Browse")) | ||
self.chkBox_openEmfOnEnd.setText(_translate("SVG2EMF", "Open EMF folder on end")) | ||
self.btn_exit.setText(_translate("SVG2EMF", "Exit")) | ||
self.btn_open_svg.setText(_translate("SVG2EMF", "Open SVG folder")) | ||
self.btn_open_emf.setText(_translate("SVG2EMF", "Open EMF folder")) | ||
self.btn_go.setText(_translate("SVG2EMF", "Go")) | ||
self.menuFile.setTitle(_translate("SVG2EMF", "File")) | ||
self.menuHelp.setTitle(_translate("SVG2EMF", "Help")) | ||
self.act_file_exit.setText(_translate("SVG2EMF", "Exit")) | ||
self.act_help_doct.setText(_translate("SVG2EMF", "Documentation")) | ||
self.act_help_about.setText(_translate("SVG2EMF", "About")) | ||
self.act_file_go.setText(_translate("SVG2EMF", "Go")) | ||
self.act_file_go.setShortcut(_translate("SVG2EMF", "Ctrl+G")) | ||
|
||
|
||
if __name__ == "__main__": | ||
import sys | ||
|
||
app = QtWidgets.QApplication(sys.argv) | ||
app.setWindowIcon(QtGui.QIcon(os.path.join('./image', 'convert.png'))) | ||
|
||
SVG2EMF = QtWidgets.QMainWindow() | ||
ui = Ui_SVG2EMF() | ||
ui.setupUi(SVG2EMF) | ||
SVG2EMF.show() | ||
sys.exit(app.exec_()) | ||
|
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Thu Jan 4 13:06:32 2018 | ||
""" | ||
|
||
import subprocess | ||
|
||
subprocess.run(r'"C:\Program Files\Inkscape\inkscape" C:\Users\306235\Documents\_Temp\SVG_to_EMF\test_time.svg --export-emf=C:\Users\306235\Documents\_Temp\SVG_to_EMF\test_time.emf', shell=True) | ||
|
||
subprocess.run(r'inkscape C:\Users\306235\Documents\_Temp\SVG_to_EMF\test_polar.svg --export-emf=C:\Users\306235\Documents\_Temp\SVG_to_EMF\test_polar.emf', shell=True) | ||
|
||
#import glob | ||
# | ||
#str_pattern = "C:/Users/306235/Documents/_Temp/**/*.svg" | ||
# | ||
#list_temp = glob.glob(str_pattern, recursive=True) | ||
# | ||
#for item in list_temp: | ||
# | ||
# print(item) | ||
|
||
# import os | ||
|
||
# os.startfile('c:/') | ||
|
||
# import gsyIO | ||
|
||
# gsyIO.open_folder('c:/') | ||
|
||
# import glob | ||
|
||
# str_pattern = "C:/Users//Documents/_Temp/**/*.svg" | ||
|
||
# for item in glob.iglob(str_pattern, recursive=True): | ||
|
||
# print(item) | ||
|
||
#from tkinter import * | ||
#import tkinter, tkconstants, tkFileDialog | ||
#root = Tk() | ||
#root.directory = tkFileDialog.askdirectory() | ||
#print (root.directory) | ||
|
||
# import gsyIO | ||
|
||
# str_folder = gsyIO.get_dir() | ||
|
||
# print('The selected folder is : ' + str_folder) |
Oops, something went wrong.