Subversion Repositories bdplot

Rev

Rev 5 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5 Rev 68
1
### Overruling with local config files if present.
1
### Overruling with local config files if present.
2
### if reread=TRUE, local config files are reread. 
2
### if reread=TRUE, local config files are reread. 
3
bd.reset <- function(reread=FALSE){
3
bd.reset <- function(reread=FALSE){
4
  if(reread){
4
  if(reread){
5
    .bdsetpars(.bdconf.default())
5
    .bdsetpars(.bdconf.default())
6
    wd <- getwd()
6
    wd <- getwd()
7
    if(!is.na(file.info("~/.bdp_config.R")$size))
7
    if(!is.na(file.info("~/.bdp_config.R")$size))
8
      {
8
      {
9
        cat("Sourcing ~/.bdp_config.R\n")
9
        cat("Sourcing ~/.bdp_config.R\n")
10
        source(file="~/.bdp_config.R")
10
        source(file="~/.bdp_config.R")
11
      }
11
      }
12
    if(!is.na(file.info(paste(wd,"bdp_config_local.R",sep="/"))$size))
12
    localconf <- paste(wd,"bdp_config_local.R",sep="/")
-
 
13
    if(!is.na(file.info(localconf)$size))
13
      {
14
      {
14
        cat("Sourcing bdp_config_local.R\n")
15
        cat("Sourcing ",localconf,"\n")
15
        source(file="bdp_config_local.R")
16
        source(file="bdp_config_local.R")
16
      }
17
      }
17
    ##     .BDPars.default should be set to .BDPars
18
    ##     .BDPars.default should be set to .BDPars
18
    .bdsetdefpars(.bdgetpars())
19
    .bdsetdefpars(.bdgetpars())
19
  } else {
20
  } else {
20
    .bdsetpars(.bdgetdefpars())
21
    .bdsetpars(.bdgetdefpars())
21
  }
22
  }
22
 
23
 
23
### this solution is kind of ugly. If the two lists contain elements of the same name, the first of them will be used. Templates should also be used from user env.
24
### this solution is kind of ugly. If the two lists contain elements of the same name, the first of them will be used. Templates should also be used from user env.
24
  .bdsetpars(c(.bdgetpars(),  .bdpapertemplates()))
25
  .bdsetpars(c(.bdgetpars(),  .bdpapertemplates()))
25
  
26
  
26
}
27
}
27
 
28