⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 options.py

📁 The ZZIPlib provides read access on ZIP-archives. The library uses only the patent-free compression-
💻 PY
字号:
#! /usr/bin/python# -*- coding: utf-8 -*-# @creator (C) 2003 Guido U. Draheim# @license http://creativecommons.org/licenses/by-nc-sa/2.0/de/from match import Match# use as o.optionname to check for commandline options.class Options:    var = {}    def __getattr__(self, name):        if not self.var.has_key(name): return None        return self.var[name]    def __setattr__(self, name, value):        self.var[name] = value    def scan(self, optionstring): # option-name or None        x = Match()        if optionstring & x(r"^--?(\w+)=(.*)"):            self.var[x[1]] = x[2] ;  return x[1]        if optionstring & x(r"^--?no-(\w+)$"):            self.var[x[1]] = "" ; return x[1]        if optionstring & x(r"^--?(\w+)$"):            self.var[x[1]] = "*"; return x[1]        return None#end Optionsif False:    o = Options()    o.help = """    scans for options    """

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -