2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

: minor code cleanup

git-svn-id: https://svn.fhem.de/fhem/trunk@21564 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
betateilchen 2020-03-31 19:08:51 +00:00
parent e9d9bd6c0f
commit 9f9d532003

View File

@ -564,12 +564,12 @@ sub cfgDB_MigrationImport() {
my $modpath = AttrVal("global","modpath","."); my $modpath = AttrVal("global","modpath",".");
# find eventTypes file # find eventTypes file
$filename = ''; # $filename = '';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=eventTypes'); @def = _cfgDB_findDef('TYPE=eventTypes');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, $filename; push @files, $fn;
} }
# import templateDB.gplot # import templateDB.gplot
@ -583,60 +583,60 @@ sub cfgDB_MigrationImport() {
push @files, $filename; push @files, $filename;
# find used gplot files # find used gplot files
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=SVG','GPLOTFILE'); @def = _cfgDB_findDef('TYPE=SVG','GPLOTFILE');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, "$modpath/www/gplot/".$filename.".gplot"; push @files, "$modpath/www/gplot/".$fn.".gplot";
} }
# find DbLog configs # find DbLog configs
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=DbLog','CONFIGURATION'); @def = _cfgDB_findDef('TYPE=DbLog','CONFIGURATION');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, $filename; push @files, $fn;
} }
# find RSS layouts # find RSS layouts
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=RSS','LAYOUTFILE'); @def = _cfgDB_findDef('TYPE=RSS','LAYOUTFILE');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, $filename; push @files, $fn;
} }
# find InfoPanel layouts # find InfoPanel layouts
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=InfoPanel','LAYOUTFILE'); @def = _cfgDB_findDef('TYPE=InfoPanel','LAYOUTFILE');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, $filename; push @files, $fn;
} }
# find weekprofile configurations # find weekprofile configurations
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=weekprofile','CONFIGFILE'); @def = _cfgDB_findDef('TYPE=weekprofile','CONFIGFILE');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
push @files, $filename; push @files, $fn;
} }
# find holiday files # find holiday files
$filename =''; # $filename ='';
@def = ''; @def = '';
@def = _cfgDB_findDef('TYPE=holiday','NAME'); @def = _cfgDB_findDef('TYPE=holiday','NAME');
foreach $filename (@def) { foreach my $fn (@def) {
next unless $filename; next unless $fn;
if(defined($defs{$filename}{HOLIDAYFILE})) { if(defined($defs{$fn}{HOLIDAYFILE})) {
push @files, $defs{$filename}{HOLIDAYFILE}; push @files, $defs{$fn}{HOLIDAYFILE};
} else { } else {
push @files, "$modpath/FHEM/".$filename.".holiday"; push @files, "$modpath/FHEM/".$fn.".holiday";
} }
} }
@ -646,12 +646,12 @@ sub cfgDB_MigrationImport() {
# do the import # do the import
$filename = ''; # $filename = '';
foreach $filename (@files) { foreach my $fn (@files) {
if ( -r $filename ) { if ( -r $fn ) {
my $filesize = -s $filename; my $filesize = -s $fn;
_cfgDB_binFileimport($filename,$filesize); _cfgDB_binFileimport($fn,$filesize);
$ret .= "importing: $filename\n"; $ret .= "importing: $fn\n";
} }
} }