Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@specs.yaql_property(DATETIME_TYPE)
def weekday(dt):
return dt.weekday()
@specs.yaql_property(dsl_types.MuranoProperty)
@specs.name('name')
def property_name(murano_property):
return murano_property.name
@specs.yaql_property(dsl_types.MuranoMethodArgument)
@specs.name('has_default')
def argument_has_default(method_argument):
return method_argument.has_default
@specs.yaql_property(DATETIME_TYPE)
def microsecond(dt):
return dt.microsecond
@specs.yaql_property(DATETIME_TYPE)
def second(dt):
return dt.second
@specs.yaql_property(yaqltypes.DateTime())
def date(dt):
return DATETIME_TYPE(
year=dt.year, month=dt.month, day=dt.day, tzinfo=dt.tzinfo)
@specs.yaql_property(dsl_types.MuranoMethodArgument)
@specs.name('declaring_method')
def argument_owner(method_argument):
return method_argument.murano_method
@specs.yaql_property(dsl_types.MuranoPackage)
def types(murano_package):
return tuple(
murano_package.find_class(cls, False)
for cls in murano_package.classes
)
@specs.yaql_property(dsl_types.MuranoType)
@specs.name('name')
def type_name(murano_type):
return murano_type.name
@specs.yaql_property(DATETIME_TYPE)
def offset(dt):
return dt.utcoffset() or ZERO_TIMESPAN