python

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Overview

Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.

nolint: lll, goconst

Pulling out some of the repeated strings tokens into constants would harm readability, so we just ignore the goconst linter's warning.

nolint: lll, goconst

Index

Constants

This section is empty.

Variables

View Source
var Keywords = map[string]bool{
	"False":    true,
	"None":     true,
	"True":     true,
	"and":      true,
	"as":       true,
	"assert":   true,
	"async":    true,
	"await":    true,
	"break":    true,
	"class":    true,
	"continue": true,
	"def":      true,
	"del":      true,
	"elif":     true,
	"else":     true,
	"except":   true,
	"exec":     true,
	"finally":  true,
	"for":      true,
	"from":     true,
	"global":   true,
	"if":       true,
	"import":   true,
	"in":       true,
	"is":       true,
	"lambda":   true,
	"nonlocal": true,
	"not":      true,
	"or":       true,
	"pass":     true,
	"print":    true,
	"raise":    true,
	"return":   true,
	"try":      true,
	"while":    true,
	"with":     true,
	"yield":    true,
}

Keywords is a map of reserved keywords used by Python 2 and 3. We use this to avoid generating unspeakable names in the resulting code. This map was sourced by merging the following reference material:

Functions

func EnsureKeywordSafe

func EnsureKeywordSafe(name string) string

EnsureKeywordSafe adds a trailing underscore if the generated name clashes with a Python 2 or 3 keyword, per PEP 8: https://www.python.org/dev/peps/pep-0008/?#function-and-method-arguments

func GeneratePackage added in v1.9.0

func GeneratePackage(tool string, pkg *schema.Package, extraFiles map[string][]byte) (map[string][]byte, error)

func PyName

func PyName(name string) string

PyName turns a variable or function name, normally using camelCase, to an underscore_case name.

Types

type DocLanguageHelper added in v1.12.1

type DocLanguageHelper struct{}

DocLanguageHelper is the Python-specific implementation of the DocLanguageHelper.

func (DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType added in v1.13.0

func (d DocLanguageHelper) GetDocLinkForFunctionInputOrOutputType(packageName, modName, typeName string, input bool) string

GetDocLinkForFunctionInputOrOutputType is not implemented at this time for Python.

func (DocLanguageHelper) GetDocLinkForResourceInputOrOutputType added in v1.13.0

func (d DocLanguageHelper) GetDocLinkForResourceInputOrOutputType(packageName, modName, typeName string, input bool) string

GetDocLinkForResourceInputOrOutputType is not implemented at this time for Python.

func (DocLanguageHelper) GetDocLinkForResourceType added in v1.12.1

func (d DocLanguageHelper) GetDocLinkForResourceType(packageName, modName, typeName string) string

GetDocLinkForResourceType is not implemented at this time for Python.

func (DocLanguageHelper) GetLanguageTypeString added in v1.12.1

func (d DocLanguageHelper) GetLanguageTypeString(pkg *schema.Package, moduleName string, t schema.Type, input, optional bool) string

GetLanguageTypeString returns the Python-specific type given a Pulumi schema type.

func (DocLanguageHelper) GetResourceFunctionResultName added in v1.13.0

func (d DocLanguageHelper) GetResourceFunctionResultName(resourceName string) string

GetResourceFunctionResultName is not implemented for Python and returns an empty string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL