-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump the version to 0.1.8 with some brake changes on progress bar imp…
…lementation
- Loading branch information
Showing
14 changed files
with
258 additions
and
126 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
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
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 |
---|---|---|
@@ -1,37 +1,51 @@ | ||
#! /usr/bin/env python3 | ||
# -*- coding:utf-8 -*- | ||
import random | ||
|
||
import time | ||
|
||
import gi | ||
|
||
gi.require_version("Gtk", "3.0") | ||
from gi.repository import GLib, Gtk | ||
from gi.repository import GLib, GObject, Gtk | ||
|
||
from src.sgzenity.SGProgresBar import ProgressBar | ||
from src.sgzenity.sgszenity import calendar, question | ||
from src.sgzenity.thread import WorkerThread | ||
|
||
from src.sgzenity.sgszenity import progress_bar, question | ||
|
||
counter = 0 | ||
_max = 1 | ||
class WorkingThread(WorkerThread): | ||
def payload(self): | ||
loading = self.data | ||
steps = 10 | ||
for s in range(steps): | ||
if self.stop: | ||
break | ||
loading.heartbeat() | ||
print('Pulse {}.'.format(s)) | ||
time.sleep(1) | ||
if self.stop: | ||
print('Working thread canceled.') | ||
else: | ||
print('Working thread ended.') | ||
loading.close() | ||
|
||
|
||
def callback_progress_bar(fraction=None): | ||
global counter | ||
counter += 0.01 | ||
if counter <= _max: | ||
return counter | ||
return True | ||
def sg_progress_bar(): | ||
|
||
loading = ProgressBar("DEMO TITLE", "DEMO TEXT", pulse_mode=True) | ||
|
||
def demo_progress_bar(): | ||
progress = progress_bar( | ||
"DEMO TITLE", "DEMO TEXT", False, callback_progress_bar, 350, 30, 10 | ||
) | ||
progress.run_progressbar() | ||
workthread = WorkingThread(loading) | ||
loading.show(workthread) | ||
workthread.start() | ||
|
||
Gtk.main() | ||
|
||
demo_progress_bar() | ||
|
||
sg_progress_bar() | ||
|
||
_error = question( | ||
"something went wrong", text="Some big text in small space", height=150, width=400 | ||
) | ||
# print(_error) | ||
|
||
_calendar = calendar("DEMO CALENDAR") | ||
print(_calendar) |
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 |
---|---|---|
@@ -1,2 +1,5 @@ | ||
Authors\n=======\n\nA huge thanks to all of our contributors:\n | ||
Authors | ||
======= | ||
|
||
A huge thanks to all of our contributors: | ||
- Zaharia Constantin |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
Oops, something went wrong.