def on_linkedin(self): def updated(*largs): from modules.core.android_utils import Toast Toast('Linkedin profile updated') from widgets.linkedin import LinkedIn self.linkedin = LinkedIn(on_complete=updated) self.linkedin.do_login()
def populate_slides(self): for file in sorted(listdir(tutorial_path)): self.carousel.add_widget( TutorialImage( source=join(tutorial_path, file))) if not user_authenticated(): linkedin = LinkedIn() linkedin.bind(on_complete=self._linkedin_login_completed) self.carousel.add_widget(linkedin) self.update_skip_button()
def item_click(self, item, touch=None): if isinstance(item, SystemPost): from widgets.linkedin import LinkedIn Logger.info('SystemPost: %s clicked' % item.key) action = item.data.get('action', '') if action == 'invite': from modules.core.android_utils import ShareActivity from config import invite_url ShareActivity(invite_url, 'Send invite') elif action == 'linkedin': if LinkedIn.isLinkedinProfileEmpty(): linkedin = LinkedIn() linkedin.do_login() def remove_sys_post(*largs): self.container.remove_widget(item) Clock.schedule_once(remove_sys_post, 3.0) else: self.dispatch('on_item_selected', item)