Skip to content

Commit

Permalink
fix go_back_in_history
Browse files Browse the repository at this point in the history
  • Loading branch information
akshayaurora committed Oct 4, 2018
1 parent b393cec commit 82f92ce
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 0 additions & 4 deletions eventsapp/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def write_oldata(fpath, data):

def on_success(oldata, endpoint, req, bl):
# got new data, update the schedule
print 'success', endpoint
ndata = None
with open(req.file_path) as f:
ndata = f.read()
Expand Down Expand Up @@ -59,12 +58,10 @@ def _check_data(req, oldata):


def on_failure(oldata, endpoint, req, bl):
print 'failure', endpoint, req.file_path
_check_data(req, oldata)


def on_error(oldata, endpoint, req, bl):
print 'error', endpoint, req.file_path
_check_data(req, oldata)


Expand All @@ -73,7 +70,6 @@ def fetch_remote_data(dt):
'''
for args in fetch_remote_data._args:
endpoint, filepath, oldata = args
print 'fetch', endpoint, filepath
UrlRequest(
#FIXME: initial url should be abstracted out too.
'https://raw.githubusercontent.com/pythonindia/'
Expand Down
8 changes: 4 additions & 4 deletions eventsapp/uix/screens/screenfeedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def on_pre_enter(self):

def on_pre_leave(self):
self.manager.transition.direction = 'down'

def on_leave(self):
self.manager.transition.direction = 'left'
self.ids.sldr.value = 0
self.ids.root.talk = ''
self.ids.talk = ''
self.ids.ti_description.text = ''
self.ids.ti_name.text = ''
self.ids.ti_ticketid.text = ''

def on_leave(self):
self.manager.transition.direction = 'left'
14 changes: 10 additions & 4 deletions eventsapp/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from kivy.app import App
from kivy.utils import platform
from kivy.uix.screenmanager import ScreenManagerException

if platform == 'android':
from jnius import autoclass, cast
JS = autoclass('java.lang.String')
Expand Down Expand Up @@ -113,14 +114,19 @@ def go_back_in_history():
app = App.get_running_app()
from utils import pause_app
try:
if not len(app._navigation_higherarchy):
scr = app._navigation_higherarchy.pop()
if scr.name == 'ScreenSchedule':
# we are at top of Nav higherarchy
pause_app()
return
scr = app._navigation_higherarchy.pop()

# we are not at root of Nav higherarchy
scr = app._navigation_higherarchy[-1]
load_screen(
scr.name,
manager=scr.manager,
store_back=False)
except ScreenManagerException:
except IndexError, ScreenManagerException:
# check if current screen is schedule screen?
pause_app()
if app.navigation_manager.current == 'ScreenSchedule':
pause_app()

0 comments on commit 82f92ce

Please sign in to comment.