startapp.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:USTC-Software-2017 作者: igemsoftware2017 项目源码 文件源码
def handle(self, **options):
        app_name, target = options.pop('name'), options.pop('directory')

        # Set the top directory to root of Biohub instead of current
        # path.
        if target is None:
            target = os.path.join(settings.BIOHUB_DIR, app_name)

            try:
                os.makedirs(target)
            except OSError as e:
                if e.errno == errno.EEXIST:
                    message = "'%s' already exists" % target
                else:
                    message = e
                raise CommandError(message)

        # Use custom app template
        if options['template'] is None:
            options['template'] = os.path.join(
                settings.BIOHUB_CORE_DIR, 'app_template')

        super(StartappCommand, self).handle('app', app_name, target, **options)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号