1 Star 0 Fork 11

DengSir/rpc-repo

forked from Plato/rpc-repo 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
option.py 1.28 KB
一键复制 编辑 原始数据 按行查看 历史
leozhou 提交于 2021-05-19 20:11 . python脚本头里面添加添加utf-8
#!/usr/bin/python
# -*- coding: UTF-8 -*-
import sys
import platform
py_version = sys.version_info.major
class Options:
def __init__(self):
self.options = {}
self.default_cpp_options()
def default_cpp_options(self):
self.options["cpp"] = {}
self.options["cpp"]["machine"] = "-m64"
self.options["cpp"]["debug"] = "true"
if platform.system() == "Windows":
self.options["cpp"]["protobuf_path"] = "C:/Program Files (x86)/protobuf"
def add_option(self, type, name, opt):
opt = opt.replace("\\", "\\\\")
if self.options is None:
self.options = {}
if py_version == 3 :
if not type in self.options:
self.options[type] = {}
else:
if not self.options.has_key(type):
self.options[type] = {}
self.options[type][name] = opt
def get_option(self, type, name):
if py_version == 3:
if type in self.options:
if name in self.options[type]:
return self.options[type][name]
else:
if self.options.has_key(type):
if self.options[type].has_key(name):
return self.options[type][name]
return None
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/DengSir/rpc-repo.git
[email protected]:DengSir/rpc-repo.git
DengSir
rpc-repo
rpc-repo
v0.3.0-alpha

搜索帮助