高仿饿了么webApp


此项目大大小小共 45 个页面,涉及注册、登录、商品展示、购物车、下单等等,是一个完整的流程。一般公司即便是官网的单页面项目都没这么复杂,如果这个项目能驾驭的了,相信大部分公司的其他单页面应用也就不在话下,即便更复杂,也不会比这个高到哪里去。
资源截图
代码片段和文件信息
#!/usr/bin/env python

# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

__doc__ = “““
gyptest.py -- test runner for GYP tests.
“““

import os
import optparse
import subprocess
import sys

class CommandRunner(object):
  “““
  Executor class for commands including “commands“ implemented by
  Python functions.
  “““
  verbose = True
  active = True

  def __init__(self dictionary={}):
    self.subst_dictionary(dictionary)

  def subst_dictionary(self dictionary):
    self._subst_dictionary = dictionary

  def subst(self string dictionary=None):
    “““
    Substitutes (via the format operator) the values in the specified
    dictionary into the specified command.

    The command can be an (action string) tuple.  In all cases we
    perform substitution on strings and don‘t worry if something isn‘t
    a string.  (It‘s probably a Python function to be executed.)
    “““
    if dictionary is None:
      dictionary = self._subst_dictionary
    if dictionary:
      try:
        string = string % dictionary
      except TypeError:
        pass
    return string

  def display(self command stdout=None stderr=None):
    if not self.verbose:
      return
    if type(command) == type(()):
      func = command[0]
      args = command[1:]
      s = ‘%s(%s)‘ % (func.__name__ ‘ ‘.join(map(repr args)))
    if type(command) == type([]):
      # TODO:  quote arguments containing spaces
      # TODO:  handle meta characters?
      s = ‘ ‘.join(command)
    else:
      s = self.subst(command)
    if not s.endswith(‘
‘):
      s += ‘

    sys.stdout.write(s)
    sys.stdout.flush()

  def execute(self command stdout=None stderr=None):
    “““
    Executes a single command.
    “““
    if not self.active:
      return 0
    if type(command) == type(‘‘):
      command = self.subst(command)
      cmdargs = shlex.split(command)
      if cmdargs[0] == ‘cd‘:
         command = (os.chdir) + tuple(cmdargs[1:])
    if type(command) == type(()):
      func = command[0]
      args = command[1:]
      return func(*args)
    else:
      if stdout is sys.stdout:
        # Same as passing sys.stdout except python2.4 doesn‘t fail on it.
        subout = None
      else:
        # Open pipe for anything else so Popen works on python2.4.
        subout = subprocess.PIPE
      if stderr is sys.stderr:
        # Same as passing sys.stderr except python2.4 doesn‘t fail on it.
        suberr = None
      elif stderr is None:
        # Merge with stdout if stderr isn‘t specified.
        suberr = subprocess.STDOUT
      else:
        # Open pipe for anything else so Popen works on python2.4.
        suberr = subprocess.PIPE
      p = subprocess.Popen(command
                           shell=(sys.platform == ‘win32‘)
                           stdout=subout
                           stderr=suberr)
      p.wait()
      if stdout is None:
        self.stdout = p

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-03 00:33  vue2-elm
     文件         102  2017-12-03 00:19  vue2-elm.babelrc
     文件         154  2017-12-03 00:19  vue2-elm.editorconfig
     目录           0  2017-12-03 00:19  vue2-elm.git
     文件          23  2017-12-03 00:19  vue2-elm.gitHEAD
     文件         306  2017-12-03 00:19  vue2-elm.gitconfig
     文件          73  2017-12-03 00:18  vue2-elm.gitdescription
     目录           0  2017-12-03 00:18  vue2-elm.githooks
     文件         478  2017-12-03 00:18  vue2-elm.githooksapplypatch-msg.sample
     文件         896  2017-12-03 00:18  vue2-elm.githookscommit-msg.sample
     文件         189  2017-12-03 00:18  vue2-elm.githookspost-update.sample
     文件         424  2017-12-03 00:18  vue2-elm.githookspre-applypatch.sample
     文件        1642  2017-12-03 00:18  vue2-elm.githookspre-commit.sample
     文件        1348  2017-12-03 00:18  vue2-elm.githookspre-push.sample
     文件        4951  2017-12-03 00:18  vue2-elm.githookspre-rebase.sample
     文件         544  2017-12-03 00:18  vue2-elm.githookspre-receive.sample
     文件        1239  2017-12-03 00:18  vue2-elm.githooksprepare-commit-msg.sample
     文件        3610  2017-12-03 00:18  vue2-elm.githooksupdate.sample
     文件       19570  2018-01-05 09:59  vue2-elm.gitindex
     目录           0  2017-12-03 00:18  vue2-elm.gitinfo
     文件         240  2017-12-03 00:18  vue2-elm.gitinfoexclude
     目录           0  2017-12-03 00:19  vue2-elm.gitlogs
     文件         179  2017-12-03 00:19  vue2-elm.gitlogsHEAD
     目录           0  2017-12-03 00:19  vue2-elm.gitlogs
efs
     目录           0  2017-12-03 00:19  vue2-elm.gitlogs
efsheads
     文件         179  2017-12-03 00:19  vue2-elm.gitlogs
efsheadsmaster
     目录           0  2017-12-03 00:19  vue2-elm.gitlogs
efs
emotes
     目录           0  2017-12-03 00:19  vue2-elm.gitlogs
efs
emotesorigin
     文件         179  2017-12-03 00:19  vue2-elm.gitlogs
efs
emotesoriginHEAD
     目录           0  2017-12-03 00:18  vue2-elm.gitobjects
     目录           0  2018-01-05 11:17  vue2-elm.gitobjectsinfo
............此处省略15976个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)