Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
screport
Compare revisions
3cbfaf20a15d7944025156711b655e5b13e0f779...c43b608d346d1ee440e874a2c19e3802847c4916
Source
BC/public/screport
Select target project
c43b608d346d1ee440e874a2c19e3802847c4916
Select Git revision
Branches
main
..
..
...
Target
BC/public/screport
Select target project
BC/public/screport
3cbfaf20a15d7944025156711b655e5b13e0f779
Select Git revision
Branches
main
Compare
Swap revisions
Commits (2)
cahnge autoClose param to windowed param
· bf41223c
Quentin Monnier
authored
2 years ago
bf41223c
change autoClose param to windowed param
· c43b608d
Quentin Monnier
authored
2 years ago
c43b608d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ProgressFrame.py
+0
-4
ProgressFrame.py
launch.py
+7
-9
launch.py
with
7 additions
and
13 deletions
ProgressFrame.py
View file @
c43b608d
...
...
@@ -10,7 +10,6 @@ class ProgressFrame(wx.Frame):
self
.
cancelMode
=
True
self
.
done
=
True
self
.
autoShow
=
False
self
.
autoClose
=
False
xSize
,
ySize
=
wx
.
DisplaySize
()
size
=
(
int
(
xSize
*
0.75
),
int
(
ySize
*
0.33
))
...
...
@@ -94,9 +93,6 @@ class ProgressFrame(wx.Frame):
if
self
.
autoShow
:
evt
=
wx
.
PyCommandEvent
(
wx
.
EVT_BUTTON
.
typeId
,
self
.
show
.
GetId
())
wx
.
PostEvent
(
self
.
show
,
evt
)
elif
self
.
autoClose
:
evt
=
wx
.
PyCommandEvent
(
wx
.
EVT_BUTTON
.
typeId
,
self
.
close
.
GetId
())
wx
.
PostEvent
(
self
.
close
,
evt
)
self
.
progress
.
SetValue
(
self
.
count
)
...
...
This diff is collapsed.
Click to expand it.
launch.py
View file @
c43b608d
...
...
@@ -8,19 +8,17 @@ from library import ScreenshotManager, SettingsManager
class
MyApp
(
wx
.
App
):
def
__init__
(
self
,
autoClose
):
def
__init__
(
self
):
super
().
__init__
(
clearSigInt
=
True
)
self
.
settingsFrame
=
SettingsFrame
(
self
.
refreshProgressDialog
)
self
.
frame
=
None
self
.
autoClose
=
autoClose
self
.
launchProgressFrame
()
def
launchProgressFrame
(
self
):
self
.
screenshotManager
=
ScreenshotManager
(
True
)
self
.
progress
=
ProgressFrame
()
self
.
progress
.
autoClose
=
self
.
autoClose
self
.
progress
.
settings
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
OnSettings
)
self
.
progress
.
show
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
OnMainFrame
)
self
.
progress
.
Bind
(
wx
.
EVT_CLOSE
,
self
.
OnClose
)
...
...
@@ -56,7 +54,7 @@ class MyApp(wx.App):
def
OnClose
(
self
,
event
):
if
event
.
CanVeto
():
if
self
.
progress
.
cancelMode
or
self
.
progress
.
done
or
self
.
progress
.
autoShow
or
self
.
progress
.
autoClose
:
if
self
.
progress
.
cancelMode
or
self
.
progress
.
done
or
self
.
progress
.
autoShow
:
self
.
screenshotManager
.
stopThread
=
True
event
.
Skip
()
if
self
.
settingsFrame
:
self
.
settingsFrame
.
Close
()
...
...
@@ -82,19 +80,19 @@ if __name__ == '__main__':
help
=
'The path to search for screenshot files'
,
required
=
False
,
dest
=
'screenshotPath'
)
parser
.
add_argument
(
'-
ac
'
,
'--
auto-close
'
,
help
=
'
To
just compare screenshot
without GUI (for CI-CD)
'
,
parser
.
add_argument
(
'-
wd
'
,
'--
windowed
'
,
help
=
'
Launch GUI or
just compare screenshot'
,
required
=
False
,
dest
=
'
autoClose
'
)
dest
=
'
windowed
'
)
args
=
parser
.
parse_args
()
settingsmanager
=
SettingsManager
()
if
args
.
referencePath
!=
None
:
settingsmanager
.
referencesPath
=
args
.
referencePath
if
args
.
screenshotPath
!=
None
:
settingsmanager
.
screenshotsPath
=
args
.
screenshotPath
settingsmanager
.
saveSettings
()
if
args
.
autoClose
==
"tru
e"
:
if
args
.
windowed
==
"fals
e"
:
ScreenshotManager
(
False
)
else
:
app
=
MyApp
(
True
if
args
.
autoClose
==
"true"
else
False
)
app
=
MyApp
()
app
.
MainLoop
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Menu
Explore
Projects
Groups
Topics
Snippets