fixes for formatting

This commit is contained in:
2024-12-31 11:00:02 +01:00
parent 8400bfc4ee
commit 92335f8828
39 changed files with 699 additions and 752 deletions

View File

@@ -20,7 +20,7 @@ mut:
params_ ?&paramsparser.Params
dbcollection_ ?&dbfs.DBCollection @[skip; str: skip]
redis_ ?&redisclient.Redis @[skip; str: skip]
path_ ?pathlib.Path
path_ ?pathlib.Path
pub mut:
// snippets map[string]string
config ContextConfig
@@ -187,9 +187,9 @@ pub fn (mut self Context) secret_set(secret_ string) ! {
}
pub fn (mut self Context) path() !pathlib.Path {
return self.path_ or {
return self.path_ or {
path2 := '${os.home_dir()}/hero/context/${self.config.name}'
mut path := pathlib.get_dir(path: path2,create: false)!
mut path := pathlib.get_dir(path: path2, create: false)!
path
}
}

View File

@@ -13,8 +13,8 @@ import freeflowuniverse.herolib.core.pathlib
@[heap]
pub struct Session {
mut:
path_ ?pathlib.Path
logger_ ?logger.Logger
path_ ?pathlib.Path
logger_ ?logger.Logger
pub mut:
name string // unique id for session (session id), can be more than one per context
interactive bool = true
@@ -24,7 +24,6 @@ pub mut:
context &Context @[skip; str: skip]
config SessionConfig
env map[string]string
}
///////// LOAD & SAVE
@@ -94,9 +93,9 @@ pub fn (self Session) guid() string {
}
pub fn (mut self Session) path() !pathlib.Path {
return self.path_ or {
return self.path_ or {
path2 := '${self.context.path()!.path}/${self.name}'
mut path := pathlib.get_dir(path: path2,create: true)!
mut path := pathlib.get_dir(path: path2, create: true)!
path
}
}

View File

@@ -3,8 +3,8 @@ module base
import freeflowuniverse.herolib.core.logger
pub fn (mut session Session) logger() !logger.Logger {
return session.logger_ or {
mut l2 := logger.new("${session.path()!.path}/logs")!
return session.logger_ or {
mut l2 := logger.new('${session.path()!.path}/logs')!
l2
}
}