Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Calamares
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
osak
Calamares
Commits
0d6daf11
Commit
0d6daf11
authored
Oct 27, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Update dummypythonqt to test PythonQt jobs.
parent
ca7728cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/dummypythonqt/main.py
+30
-3
30 additions, 3 deletions
src/modules/dummypythonqt/main.py
with
30 additions
and
3 deletions
src/modules/dummypythonqt/main.py
+
30
−
3
View file @
0d6daf11
...
...
@@ -21,6 +21,7 @@
import
platform
from
PythonQt.QtGui
import
*
import
PythonQt.calamares
as
calamares
# Set up translations.
# You may skip this if your Calamares module has no user visible strings.
...
...
@@ -33,9 +34,11 @@ import inspect
import
os
filename
=
inspect
.
getframeinfo
(
inspect
.
currentframe
()).
filename
path
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
filename
))
t
=
gettext
.
translation
(
'
dummypythonqt
'
,
os
.
path
.
join
(
path
,
'
lang
'
))
_
=
t
.
lgettext
# t = gettext.translation('dummypythonqt',
# os.path.join(path, 'lang'),
# languages=['en'])
#_ = t.lgettext
_
=
gettext
.
gettext
# Example Python ViewModule.
# A Python ViewModule is a Python program which defines a ViewStep class.
...
...
@@ -84,5 +87,29 @@ class DummyPythonQtViewStep():
def
isAtEnd
(
self
):
return
True
def
jobs
(
self
):
return
[
DummyPQJob
(
"
hi there lol
"
)]
def
widget
(
self
):
return
self
.
main_widget
class
DummyPQJob
():
def
__init__
(
self
,
my_msg
):
self
.
my_msg
=
my_msg
def
pretty_name
(
self
):
return
_
(
"
The Dummy PythonQt Job
"
)
def
pretty_description
(
self
):
return
_
(
"
This description says that the Dummy PythonQt Job is a dummy.
"
"
The dummy job says: {}
"
.
format
(
self
.
my_msg
))
def
pretty_status_message
(
self
):
return
_
(
"
A status message for DPQ Job.
"
)
def
exec
(
self
):
rmp
=
calamares
.
global_storage
[
'
rootMountPoint
'
]
os
.
system
(
"
touch {}/calamares_dpqt_was_here
"
.
format
(
rmp
))
calamares
.
utils
.
debug
(
"
the dummy job says {}
"
.
format
(
self
.
my_msg
))
return
{
'
ok
'
:
True
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment