• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python util.get_full_url函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中util.get_full_url函数的典型用法代码示例。如果您正苦于以下问题:Python get_full_url函数的具体用法?Python get_full_url怎么用?Python get_full_url使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_full_url函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform common post authorization tasks.

    Subscribes the service to notifications for the user.
    Creates tasks service and oauths it in.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    tasks_service = util.create_service('tasks', 'v1', creds)

    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()
开发者ID:jbyeung,项目名称:glassgtasks,代码行数:25,代码来源:handler.py


示例2: perform_post_auth_tasks

	def perform_post_auth_tasks(self, userid, creds):
		""" perform housekeeping tasks """
		mirror_service = util.create_service('mirror', 'v1', creds)
		
		# insert a TIMELINE subscription
		timeline_subscription_body = {
			'collection' : 'timeline',
			'userToken' : userid,
			'verifyToken' : 'sideout92',
			'callbackUrl' : util.get_full_url(self, '/notify')
		}
		
		mirror_service.subscriptions().insert(body=timeline_subscription_body).execute()
		
		waterlogg_image = util.get_full_url(self, '/static/images/waterlogg.jpg')
		
		# insert a sharing contact for WaterLogg
		waterlogg_body = {
			'id' : 'waterlogg',
			'displayName' : 'WaterLogg',
			'imageUrls' : [ waterlogg_image ],
			'acceptCommands' : [ { 'type' : 'POST_AN_UPDATE' } ]
		}
		
		mirror_service.contacts().insert(body=waterlogg_body).execute()
		
		# insert a greeting card
		timeline_item_body = {
			'html' : '<article><figure><img src="%s"/></figure><section><p class="text-small">Thanks for enabling Waterlogg!</p><p class="text-x-small">Usage: "OK Glass...Post an update...Waterlogg"</p></section><footer>Enjoy!</footer></article>' % waterlogg_image,
			'notification' : { 'level' : 'DEFAULT' },
			'menuItems' : [ { 'action' : 'DELETE' } ]		
		}
		
		mirror_service.timeline().insert(body=timeline_item_body).execute()
开发者ID:jasonsalas,项目名称:WaterLoggforGlass,代码行数:34,代码来源:handler.py


示例3: _perform_post_auth_tasks

    def _perform_post_auth_tasks(self, userid, creds):
        """Perform commong post authorization tasks.

        Subscribes the service to notifications for the user and add one sharing
        contact.

        Args:
          userid: ID of the current user.
          creds: Credentials for the current user.
        """
        mirror_service = util.create_service('mirror', 'v1', creds)
        hostname = util.get_full_url(self, '')

        subscription_body = {
                'collection': 'timeline',
                # TODO: hash the userToken.
                'userToken': userid,
                'callbackUrl': util.get_full_url(self, '/notify')
            }

        # Only do the post auth tasks when deployed.
        if hostname.startswith('https://'):
            # Insert a subscription.
            logging.info('Inserting subscription in depoloyed mode')
            mirror_service.subscriptions().insert(
                    body=subscription_body).execute()

            glassfit.contact.create_contact(mirror_service)
        else:
            logging.info("Supposed to create contact ...")
            logging.info('Creating a subscription using a proxy - LOCAL')
            subscription_body['callbackUrl'] = get_proxy_url('/notify')
            mirror_service.subscriptions().insert(
                    body=subscription_body).execute()
开发者ID:stigsfoot,项目名称:glassfit,代码行数:34,代码来源:handler.py


示例4: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform common post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()

      # Insert a sharing contact.
      contact_body = {
          'id': 'Light Palette',
          'displayName': 'Light Palette',
          'imageUrls': [util.get_full_url(self, '/static/images/rings.png')]
      }
      mirror_service.contacts().insert(body=contact_body).execute()
    else:
      logging.info('Post auth tasks are not supported on staging.')
开发者ID:learnglass,项目名称:light-palette,代码行数:33,代码来源:handler.py


示例5: _new_counter

  def _new_counter(self):
    """Insert a timeline item."""
    logging.info('Inserting timeline item')
    # Note that icons will not show up when making counters on a
    # locally hosted web interface.
    body = {
        'notification': {'level': 'DEFAULT'},
        'menuItems': [
            {
                'action': 'CUSTOM',
                'id': 'increment',
                'values': [{
                    'displayName': 'Increment',
                    'iconUrl': util.get_full_url(
                        self, '/static/images/up.png')}]
            },
            {
                'action': 'CUSTOM',
                'id': 'decrement',
                'values': [{
                    'displayName': 'Decrement',
                    'iconUrl': util.get_full_url(
                        self, '/static/images/down.png')}]
            },
            {
                'action': 'CUSTOM',
                'id': 'reset',
                'values': [{
                    'displayName': 'Set Counter to 0',
                    'iconUrl': util.get_full_url(
                        self, '/static/images/reset.png')}]
            },
            {'action': 'SHARE'},
            {'action': 'TOGGLE_PINNED'},
            {'action': 'DELETE'}
        ]
    }
    new_fields = {
        'name': self.request.get('name'),
        'num': util.get_num(self.request.get('num'))
    }
    custom_item_fields.set_multiple(
        body, new_fields, TIMELINE_ITEM_TEMPLATE_URL)

    # self.mirror_service is initialized in util.auth_required.
    self.mirror_service.timeline().insert(body=body).execute()

    # Subscribe to timeline notifications if not yet subscribed. A
    # subscription should have been made during initial OAuth grant
    # but user could have unsubscribed via /subscription for debugging.
    try:
      self._subscribe()
    except HttpError:
      return (
          'A counter was made but '
          'Notifications were not enabled because an HTTP Error occured. '
          'A common cause of this problem is not using an HTTPS connection.'
      )
    return  'A new counter has been created.'
开发者ID:AVert,项目名称:mirror-counter-sample-python,代码行数:59,代码来源:main_handler.py


示例6: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform commong post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
		
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()
		
      # Location subscription.
      subscription_body = {
          'collection': 'locations',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()

      # Insert a sharing contact.
      #contact_body = {
      #    'id': 'Python Quick Start',
      #    'displayName': 'Python Quick Start',
      #    'imageUrls': [util.get_full_url(self, '/static/images/python.png')]
      #}
      #mirror_service.contacts().insert(body=contact_body).execute()
	  
      # Insert welcome message.
      #timeline_item_body = {
      #    'text': 'Niantic software online.',
      #    'notification': {
      #        'level': 'DEFAULT'
      #    }
      #}
      #mirror_service.timeline().insert(body=timeline_item_body).execute()
	  
    else:
      logging.info('Post auth tasks are not supported on staging.')
开发者ID:alex-alex,项目名称:ingress-for-glass-old,代码行数:53,代码来源:handler.py


示例7: _insert_item

    def _insert_item(self):
        """Insert a timeline item."""
        logging.info('Inserting timeline item')
        body = {
            'notification': {'level': 'DEFAULT'}
        }
        if self.request.get('html') == 'on':
            body['html'] = [self.request.get('message')]
        else:
            body['text'] = self.request.get('message')

        media_link = self.request.get('imageUrl')
        if media_link:
            if media_link.startswith('/'):
                media_link = util.get_full_url(self, media_link)
            resp = urlfetch.fetch(media_link, deadline=20)
            media = MediaIoBaseUpload(
                io.BytesIO(resp.content), mimetype='image/jpeg', resumable=True)
        else:
            media = None

        # self.mirror_service is initialized in util.auth_required.
        self.mirror_service.timeline().insert(
            body=body, media_body=media).execute()
        return 'A timeline item has been inserted.'
开发者ID:derekchiang,项目名称:mirror-quickstart-python,代码行数:25,代码来源:main_handler.py


示例8: _insert_item

  def _insert_item(self):
    """Insert a timeline item."""
    logging.info('Inserting timeline item')
    translator = Translator(client_id, client_secret)
    origional_txt = ''
    translate_txt = ''
    body = {
        'notification': {'level': 'DEFAULT'}
    }
    if self.request.get('html') == 'on':
      body['html'] = [self.request.get('message')]
    else:
      origional_txt = self.request.get('message')
      translate_txt = translator.translate(origional_txt, "zh-CHS")
      body['text'] = translate_txt 

    media_link = self.request.get('imageUrl')
    if media_link:
      if media_link.startswith('/'):
        media_link = util.get_full_url(self, media_link)
      resp = urlfetch.fetch(media_link, deadline=20)
      media = MediaIoBaseUpload(
          io.BytesIO(resp.content), mimetype='image/jpeg', resumable=True)
    else:
      media = None

    # self.mirror_service is initialized in util.auth_required.
    self.mirror_service.timeline().insert(body=body, media_body=media).execute()
    return  '%s is translated to %s' %  (origional_txt, translate_txt)
开发者ID:macyk,项目名称:GlassDictionary,代码行数:29,代码来源:main_handler.py


示例9: _insert_response_with_reply_option

  def _insert_response_with_reply_option(self):
    """Insert a timeline item user can reply to."""
    logging.info('Inserting timeline item')
    body = {
        'creator': {
            'displayName': 'Your virtual assistant',
            'id': 'PYTHON_STARTER_PROJECT',
            'imageUrls': [
              'https://cloudanswers-concierge.herokuapp.com/public/img/cloudonly-glass.png'
            ]
        },
        'notification': {'level': 'DEFAULT'},
        'menuItems': [
          {'action': 'REPLY'}
        ]
    }

    if self.request.get('html') == 'on':
      body['html'] = [self.request.get('message')]
    else:
      body['text'] = self.request.get('message')

    media_link = self.request.get('imageUrl')
    if media_link:
      if media_link.startswith('/'):
        media_link = util.get_full_url(self, media_link)
      resp = urlfetch.fetch(media_link, deadline=20)
      media = MediaIoBaseUpload(
          io.BytesIO(resp.content), mimetype='image/jpeg', resumable=True)
    else:
      media = None

    # self.mirror_service is initialized in util.auth_required.
    self.mirror_service.timeline().insert(body=body).execute()
    return 'A timeline item with action has been inserted.'
开发者ID:natea,项目名称:glassva,代码行数:35,代码来源:main_handler.py


示例10: _insert_item

  def _insert_item(self):
    """Insert a timeline item."""
    logging.info('Inserting timeline item')
    body = {
        'notification': {'level': 'DEFAULT'},
        'html': "<article>\n  <section>\n    <ul class=\"text-x-small\">\n      <li>Gingerbread</li>\n      <li>Chocolate Chip Cookies</li>\n      <li>Tiramisu</li>\n      <li>Donuts</li>\n      <li>Sugar Plum Gummies</li>\n    </ul>\n  </section>\n  <footer>\n    <p>Grocery list</p>\n  </footer>\n</article>\n"
    }
    if self.request.get('html') == 'on':
      body['html'] = [self.request.get('message')]
    else:
      body['text'] = self.request.get('message')

    media_link = self.request.get('imageUrl')
    if media_link:
      if media_link.startswith('/'):
        media_link = util.get_full_url(self, media_link)
      resp = urlfetch.fetch(media_link, deadline=20)
      media = MediaIoBaseUpload(
          io.BytesIO(resp.content), mimetype='image/jpeg', resumable=True)
    else:
      media = None

    # self.mirror_service is initialized in util.auth_required.
    self.mirror_service.timeline().insert(body=body, media_body=media).execute()
    return  'A timeline item has been inserted.'
开发者ID:uncamy,项目名称:StartupWeekend,代码行数:25,代码来源:main_handler.py


示例11: post

	def post(self):
		callback_body = self.request.get('callback_body')
		data = json.loads(callback_body)
	
		for user_action in data.get('userActions', []):
			""" update data via the Fitbit API """
			if user_action.get('type') == 'LAUNCH':			
				# fetch the timeline item
				itemId = data['itemId']
				self.mirror_service = util.create_service('mirror', 'v1', StorageByKeyName(Credentials, data['userToken'], 'credentials').get())
				item = self.mirror_service.timeline().get(id=itemId).execute()
				water_volume = item.get('text')
				
				# set Temboo parameters
				UNIT = 'fl oz'
				TIME_OFFSET = str(date.today())
				ACCESS_TOKEN = 'YOUR_TEMBOO_ACCESS_TOKEN'
				ACCESS_TOKEN_SECRET = 'YOUR_TEMBOO_ACCESS_TOKEN_SECRET'
				CONSUMER_SECRET = 'YOUR_TEMBOO_CONSUMER_SECRET'
				CONSUMER_KEY = 'YOUR_TEMBOO_CONSUMER_KEY'
				
				# create a session with the Temboo account details
				session = TembooSession('YOUR_APP_ARGUMENTS')

				# instantiate the Choreo
				logWaterChoreo = LogWater(session)

				# get an InputSet object for the Choreo
				logWaterInputs = logWaterChoreo.new_input_set()
				
				# Set credential to use for execution
				logWaterInputs.set_credential('YOUR_APP_CREDENTIAL_NAME')
				
				# values from the Tembloo app console
				logWaterInputs.set_Amount(water_volume)
				logWaterInputs.set_AccessToken(ACCESS_TOKEN)
				logWaterInputs.set_Date(TIME_OFFSET)
				logWaterInputs.set_AccessTokenSecret(ACCESS_TOKEN_SECRET)
				logWaterInputs.set_ConsumerSecret(CONSUMER_SECRET)
				logWaterInputs.set_ConsumerKey(CONSUMER_KEY)
				logWaterInputs.set_Unit(UNIT)
				
				#execute the Choreo
				logWaterResults = logWaterChoreo.execute_with_results(logWaterInputs)

				# log the Choreo outputs
				logging.info('WATER VOLUME POSTED TO FITBIT API: %s' % logWaterResults.get_Response())
				
				# insert a card thanking the user for the transaction
				waterlogg_image = util.get_full_url(self, '/static/images/waterlogg-welcome.jpg')
				
				confirmation_card = {
					'html' : '<article><figure><img src="%s"/></figure><section><p class="text-normal">You have logged <span class="green text-large"><strong>%s</strong></span> fluid ounces of water in Fitbit!</p></section></article>' % (waterlogg_image, water_volume),
					'notification' : { 'level' : 'DEFAULT' },
					'menuItems' : [ { 'action' : 'DELETE' } ]
				}
				
				self.mirror_service.timeline().insert(body=confirmation_card).execute()
开发者ID:jasonsalas,项目名称:WaterLoggforGlass,代码行数:58,代码来源:handler.py


示例12: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform common post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()

      # Insert a sharing contact.
      contact_body = {
          'id': 'python-quick-start',
          'displayName': 'Python Quick Start',
          'imageUrls': [util.get_full_url(self, '/static/images/python.png')],
          'acceptCommands': [{ 'type': 'TAKE_A_NOTE' }]
      }
      mirror_service.contacts().insert(body=contact_body).execute()
    else:
      logging.info('Post auth tasks are not supported on staging.')

    # Insert welcome message.
    timeline_item_body = {
        'text': 'Welcome to the Python Quick Start',
        'notification': {
            'level': 'DEFAULT'
        }
    }
    #mirror_service.timeline().insert(body=timeline_item_body).execute()
    timestamp = int(time.time())
    text = 'I have Created Priyanka' + str(timestamp)
开发者ID:ptyagi911,项目名称:mirror-quickstart-python,代码行数:45,代码来源:handler.py


示例13: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform commong post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()

      # Insert a sharing contact.
      contact_body = {
          'id': 'words_with_glass',
          'displayName': 'Words with Glass',
          'imageUrls': [util.get_full_url(self, '/static/images/python.png')],
          'menuItems': [{'action': 'REPLY'}, {'action': 'TOGGLE_PINNED'}],
      }
      mirror_service.contacts().insert(body=contact_body).execute()
    else:
      logging.info('Post auth tasks are not supported on staging.')

    # Insert welcome message.
    timeline_item_body = {
        'text': 'Welcome to the Words with Glass',
        'notification': {
            'level': 'DEFAULT'
        }
    }
    mirror_service.timeline().insert(body=timeline_item_body).execute()
开发者ID:macyk,项目名称:GlassDictionary,代码行数:43,代码来源:handler.py


示例14: _perform_post_auth_tasks

    def _perform_post_auth_tasks(self, userid, creds):
        """Perform common post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """

        mirror_service = util.create_service("mirror", "v1", creds)
        hostname = util.get_full_url(self, "")

        # Only do the post auth tasks when deployed.
        if hostname.startswith("https://"):

            # Insert a subscription.
            timeline_subscription_body = {
                "collection": "timeline",
                "userToken": userid,  # TODO: hash the userToken.
                "callbackUrl": util.get_full_url(self, "/notify"),
            }
            mirror_service.subscriptions().insert(body=timeline_subscription_body).execute()

            location_subscription_body = {
                "collection": "locations",
                "userToken": userid,  # TODO: hash the userToken.
                "callbackUrl": util.get_full_url(self, "/notify"),
            }
            mirror_service.subscriptions().insert(body=location_subscription_body).execute()

            # Insert a sharing contact.
            contact_body = {
                "id": "washington-historic-register",
                "displayName": "Washington Historic Register",
                "imageUrls": [util.get_full_url(self, "/static/images/dahp-logo-trans.png")],
                "acceptCommands": [{"type": "TAKE_A_NOTE"}],
            }
            mirror_service.contacts().insert(body=contact_body).execute()

        else:
            logging.info("Post auth tasks are not supported on staging.")
开发者ID:WaTech,项目名称:Washington-Historical-Register,代码行数:43,代码来源:handler.py


示例15: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform commong post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')

    # Only do the post auth tasks when deployed.
    if hostname.startswith('https://'):
      # Insert a subscription.
      subscription_body = {
          'collection': 'timeline',
          # TODO: hash the userToken.
          'userToken': userid,
          'callbackUrl': util.get_full_url(self, '/notify')
      }
      mirror_service.subscriptions().insert(body=subscription_body).execute()

      # Insert a sharing contact.
      contact_body = {
          'id': 'GlassShare',
          'displayName': 'GlassShare',
          'imageUrls': [util.get_full_url(self, '/static/images/glyphicons_011_camera.png')]
      }
      mirror_service.contacts().insert(body=contact_body).execute()
    else:
      logging.info('Post auth tasks are not supported on staging.')

    # Insert welcome message.
    timeline_item_body = {
        'text': 'GlassShare will allow you to share your content to a specific email address.',
        'notification': {
            'level': 'DEFAULT'
        }
    }
    mirror_service.timeline().insert(body=timeline_item_body).execute()
开发者ID:harperreed,项目名称:glass_share,代码行数:42,代码来源:handler.py


示例16: _insert_subscription

 def _insert_subscription(self):
     """Subscribe the app."""
     # self.userid is initialized in util.auth_required.
     body = {
         "collection": self.request.get("collection", "timeline"),
         "userToken": self.userid,
         "callbackUrl": util.get_full_url(self, "/notify"),
     }
     # self.mirror_service is initialized in util.auth_required.
     self.mirror_service.subscriptions().insert(body=body).execute()
     return "Application is now subscribed to updates."
开发者ID:jnegre,项目名称:ingress-for-glass,代码行数:11,代码来源:main_handler.py


示例17: _insert_subscription

    def _insert_subscription(self):
        """Subscribe the app."""
        body = {
            'collection': self.request.get('collection', 'timeline'),
            'userToken': self.userid,
            'callbackUrl': util.get_full_url(self, '/notify')
        }

        # self.mirror_service is initialized in util.auth_required.
        self.mirror_service.subscriptions().insert(body=body).execute()
        return 'Application is now subscribed to updates.'
开发者ID:WaTech,项目名称:Washington-Historical-Register,代码行数:11,代码来源:main_handler.py


示例18: _bike_update

 def _bike_update(self):
   """Insert a timeline item user can reply to."""
   logging.info('Inserting timeline item')
   iconUrl = util.get_full_url(self, '/static/images/bike.png')
   user_data.set_user('macy', 'Toronto')
   body = {
       'creator': {
           'displayName': 'Bike Share APP',
           'id': 'BikeShareForGlass'
       },
       'text': 'Grab a bike',
       'notification': {'level': 'DEFAULT'},
       'menuItems': [{'action': 'CUSTOM','id': 'getbike', 'values':[{'displayName':'Get Bikes','iconUrl':iconUrl,
         'callbackUrl': util.get_full_url(self, '/notify')}]}, 
         {'action': 'CUSTOM','id': 'getstop', 'values':[{'displayName':'Get Stops','iconUrl':iconUrl,
         'callbackUrl': util.get_full_url(self, '/notify')}]},
         {'action': 'TOGGLE_PINNED'},{'action': 'DELETE'}]
   }
   # self.mirror_service is initialized in util.auth_required.
   self.mirror_service.timeline().insert(body=body).execute()
   return 'a bike card has been sent to user.'
开发者ID:macyk,项目名称:BikeShare,代码行数:21,代码来源:main_handler.py


示例19: _perform_post_auth_tasks

  def _perform_post_auth_tasks(self, userid, creds):
    """Perform commong post authorization tasks.

    Subscribes the service to notifications for the user and add one sharing
    contact.

    Args:
      userid: ID of the current user.
      creds: Credentials for the current user.
    """
    mirror_service = util.create_google_service('mirror', 'v1', creds)
    hostname = util.get_full_url(self, '')
开发者ID:codeminders,项目名称:m-distance,代码行数:12,代码来源:handler.py


示例20: _render_template

  def _render_template(self, message=None):
    """Render the main page template."""
    template_values = {'userId': self.userid}
    if message:
      template_values['message'] = message
    # self.mirror_service is initialized in util.auth_required.

    template_values['subscriptions'] = (
        self.mirror_service.subscriptions().list().execute().get('items', []))
    template_values['subscriptionUrl'] = util.get_full_url(self, '/notify')

    template = jinja_environment.get_template('templates/subscription.html')
    self.response.out.write(template.render(template_values))
开发者ID:AVert,项目名称:mirror-counter-sample-python,代码行数:13,代码来源:handler.py



注:本文中的util.get_full_url函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python util.get_hostname函数代码示例发布时间:2022-05-27
下一篇:
Python util.get_flags函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap