Subversion Repositories bdplot

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 pdel 1
.BdplotEnv <- new.env(parent=emptyenv())
2
.bdgetpars <- function() get(".BDPars", .BdplotEnv, inherits=FALSE)
3
.bdsetpars <- function(value) assign(".BDPars", value, envir=.BdplotEnv)
4
 
5
### Overruling with local config files if present.
6
### if reread=TRUE, local config files are reread. 
7
bd.reset <- function(reread=FALSE){
8
  if(reread){
9
    .bdsetpars(.bdconf.default())
10
    wd <- getwd()
11
    if(!is.na(file.info("~/.bdp_config.R")$size))
12
      {
13
        cat("Sourcing ~/.bdp_config.R\n")
14
        source(file="~/.bdp_config.R")
15
      }
16
    if(!is.na(file.info(paste(wd,"bdp_config_local.R",sep="/"))$size))
17
      {
18
        cat("Sourcing bdp_config_local.R\n")
19
        source(file="bdp_config_local.R")
20
      }
21
  } else {
22
    .bdsetpars(.BDPars.default)
23
  }
24
 
25
### this solution is kind of ugly. If the two lists contain elements of the same name, the first of them will be used.
26
.bdsetpars(c(.bdgetpars(),  .bdpapertemplates()))
27
 
28
}
29
 
30
bd.reset(reread=T)
31
 
32
.BDPars.default <- .bdgetpars()