Skip to content

Commit 82f92ce

Browse files
committed
fix go_back_in_history
1 parent b393cec commit 82f92ce

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

eventsapp/network/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ def write_oldata(fpath, data):
2525

2626
def on_success(oldata, endpoint, req, bl):
2727
# got new data, update the schedule
28-
print 'success', endpoint
2928
ndata = None
3029
with open(req.file_path) as f:
3130
ndata = f.read()
@@ -59,12 +58,10 @@ def _check_data(req, oldata):
5958

6059

6160
def on_failure(oldata, endpoint, req, bl):
62-
print 'failure', endpoint, req.file_path
6361
_check_data(req, oldata)
6462

6563

6664
def on_error(oldata, endpoint, req, bl):
67-
print 'error', endpoint, req.file_path
6865
_check_data(req, oldata)
6966

7067

@@ -73,7 +70,6 @@ def fetch_remote_data(dt):
7370
'''
7471
for args in fetch_remote_data._args:
7572
endpoint, filepath, oldata = args
76-
print 'fetch', endpoint, filepath
7773
UrlRequest(
7874
#FIXME: initial url should be abstracted out too.
7975
'https://raw.githubusercontent.com/pythonindia/'

eventsapp/uix/screens/screenfeedback.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ def on_pre_enter(self):
7474

7575
def on_pre_leave(self):
7676
self.manager.transition.direction = 'down'
77-
78-
def on_leave(self):
79-
self.manager.transition.direction = 'left'
8077
self.ids.sldr.value = 0
81-
self.ids.root.talk = ''
78+
self.ids.talk = ''
8279
self.ids.ti_description.text = ''
8380
self.ids.ti_name.text = ''
8481
self.ids.ti_ticketid.text = ''
82+
83+
def on_leave(self):
84+
self.manager.transition.direction = 'left'

eventsapp/utils/__init__.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from kivy.app import App
44
from kivy.utils import platform
55
from kivy.uix.screenmanager import ScreenManagerException
6+
67
if platform == 'android':
78
from jnius import autoclass, cast
89
JS = autoclass('java.lang.String')
@@ -113,14 +114,19 @@ def go_back_in_history():
113114
app = App.get_running_app()
114115
from utils import pause_app
115116
try:
116-
if not len(app._navigation_higherarchy):
117+
scr = app._navigation_higherarchy.pop()
118+
if scr.name == 'ScreenSchedule':
119+
# we are at top of Nav higherarchy
117120
pause_app()
118121
return
119-
scr = app._navigation_higherarchy.pop()
122+
123+
# we are not at root of Nav higherarchy
124+
scr = app._navigation_higherarchy[-1]
120125
load_screen(
121126
scr.name,
122127
manager=scr.manager,
123128
store_back=False)
124-
except ScreenManagerException:
129+
except IndexError, ScreenManagerException:
125130
# check if current screen is schedule screen?
126-
pause_app()
131+
if app.navigation_manager.current == 'ScreenSchedule':
132+
pause_app()

0 commit comments

Comments
 (0)