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
f1d6cc02
Commit
f1d6cc02
authored
Oct 4, 2016
by
Teo Mrnjavac
Browse files
Options
Downloads
Patches
Plain Diff
Rewritten dummypythonqt module to work with current API state.
parent
53f68758
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
+39
-25
39 additions, 25 deletions
src/modules/dummypythonqt/main.py
with
39 additions
and
25 deletions
src/modules/dummypythonqt/main.py
+
39
−
25
View file @
f1d6cc02
...
@@ -18,30 +18,44 @@
...
@@ -18,30 +18,44 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import
os
import
platform
from
time
import
gmtime
,
strftime
,
sleep
from
PythonQt.QtGui
import
*
from
PythonQt.QtGui
import
*
from
PythonQt.calamares
import
*
def
run
():
# Example Python ViewModule.
"""
Example Python jobmodule.
# A Python ViewModule is a Python program which defines a ViewStep class.
# This class must be marked with the @calamares_module decorator. A
A Python jobmodule is a Python program which imports libcalamares and
# ViewModule may define other classes, but only one may be decorated with
has a function run() as entry point. run() must return None if everything
# @calamares_module. Such a class must conform to the Calamares ViewStep
went well, or a tuple (str,str) with an error message and description
# interface and functions as the entry point of the module.
if something went wrong.
# A ViewStep manages one or more "wizard pages" through methods like
# back/next, and reports its status through isNextEnabled/isBackEnabled/
:return:
# isAtBeginning/isAtEnd. The whole UI, including all the pages, must be
"""
# exposed as a single QWidget, returned by the widget function.
print
(
"
foo bar quux
"
)
@calamares_module
os
.
system
(
"
/bin/sh -c
\"
touch ~/calamares-dummypythonqt
\"
"
)
class
DummyPythonQtViewStep
():
accumulator
=
strftime
(
"
%Y-%m-%d %H:%M:%S
"
,
gmtime
())
+
"
\n
"
def
__init__
(
self
):
self
.
main_widget
=
QLabel
()
box
=
QLabel
(
accumulator
)
box
.
show
()
accumulator
=
"
\n
Calamares+PythonQt running embedded Python
"
+
\
print
(
accumulator
)
platform
.
python_version
()
self
.
main_widget
.
text
=
accumulator
# To indicate an error, return a tuple of:
# (message, detailed-error-message)
def
prettyName
(
self
):
return
None
return
"
Dummy PythonQt ViewStep
"
def
isNextEnabled
(
self
):
return
True
def
isBackEnabled
(
self
):
return
True
def
isAtBeginning
(
self
):
return
True
def
isAtEnd
(
self
):
return
True
def
widget
(
self
):
return
self
.
main_widget
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