cleaning
This commit is contained in:
1 parent
6f72497a24
commit
d51d611905
11 files changed
+21
-33
No files matched your search
@@ -1,16 +1,23 @@
|
||||
import PySimpleGUI as sg
|
||||
import sys
|
||||
import subprocess
|
||||
import sys, os
|
||||
|
||||
if len(sys.argv) == 1:
|
||||
fname = sg.Window('My Script',
|
||||
[[sg.Text('Document to open')],
|
||||
[sg.In(), sg.FileBrowse()],
|
||||
if len(sys.argv) > 1:
|
||||
cmd = "python scripts/run.py " + str(sys.argv[1] )
|
||||
print(cmd)
|
||||
p = subprocess.Popen(cmd, shell=True)
|
||||
else:
|
||||
fname = sg.Window('Files exporter',
|
||||
[[sg.Text('Folder to export')],
|
||||
[sg.In(), sg.FolderBrowse()],
|
||||
[sg.Open(), sg.Cancel()]]).read(close=True)[1][0]
|
||||
else:
|
||||
fname = sys.argv[1]
|
||||
|
||||
if not fname:
|
||||
sg.popup("Cancel", "No filename supplied")
|
||||
raise SystemExit("Cancelling: no filename supplied")
|
||||
else:
|
||||
sg.popup('The filename you chose was', fname)
|
||||
if not fname:
|
||||
sg.popup("Cancel", "No filename supplied")
|
||||
raise SystemExit("Cancelling: no filename supplied")
|
||||
else:
|
||||
# sg.popup('The filename you chose was', fname)
|
||||
print(fname)
|
||||
cmd = "python scripts/run.py " + str(fname)
|
||||
print(cmd)
|
||||
p = subprocess.Popen(cmd, shell=True)
|
||||
@@ -1,19 +0,0 @@
|
||||
# example: .\run.py path\Part1
|
||||
import os
|
||||
import sys
|
||||
import pathlib
|
||||
import subprocess
|
||||
|
||||
# folder input
|
||||
if(sys.argv[1]):
|
||||
pass
|
||||
|
||||
files = sys.argv[1:] # take files given in input
|
||||
currentPath = str(pathlib.Path().resolve())
|
||||
|
||||
for i in files:
|
||||
input = str(i)
|
||||
commandstep = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + "\export-step.ps1 " + input
|
||||
commandPdfDxf = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + "\export-pdf-dxf.ps1 " + input
|
||||
subprocess.run(commandstep)
|
||||
subprocess.run(commandPdfDxf)
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -45,13 +45,13 @@ if not os.path.exists(outputFolder):
|
||||
# part files
|
||||
for i in track(partWithoutExention, description="Exporting step files..."):
|
||||
input = str(i)
|
||||
commandstep = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + '\export-step.ps1 "' + path + "\\" + input + '" "' + outputFolder + input + '"'
|
||||
commandstep = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + '\scripts\export-step.ps1 "' + path + "\\" + input + '" "' + outputFolder + input + '"'
|
||||
# print(commandstep)
|
||||
subprocess.run(commandstep, capture_output=True)
|
||||
|
||||
# drawings files
|
||||
for i in track(drwgWithoutExtension, description="Exporting PDF and DXF..."):
|
||||
input = str(i)
|
||||
commandPdfDxf = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + '\export-pdf-dxf.ps1 "' + path + "\\" + input + '" "' + outputFolder + input + '"'
|
||||
commandPdfDxf = "PowerShell -NoProfile -ExecutionPolicy Bypass -File " + currentPath + '\scripts\export-pdf-dxf.ps1 "' + path + "\\" + input + '" "' + outputFolder + input + '"'
|
||||
# print(commandPdfDxf)
|
||||
subprocess.run(commandPdfDxf, capture_output=True)
|
||||
Reference in new issue
Block a user