mirror of
https://github.com/markqvist/NomadNet.git
synced 2025-02-25 01:19:57 -05:00
Add node examples on first run
This commit is contained in:
parent
681295a818
commit
6aca6d671a
@ -168,11 +168,19 @@ class NomadNetworkApp:
|
|||||||
RNS.log("Check your configuration file for errors!", RNS.LOG_ERROR)
|
RNS.log("Check your configuration file for errors!", RNS.LOG_ERROR)
|
||||||
nomadnet.panic()
|
nomadnet.panic()
|
||||||
else:
|
else:
|
||||||
|
if not os.path.isdir(self.examplespath):
|
||||||
|
try:
|
||||||
|
os.makedirs(self.examplespath)
|
||||||
|
from distutils.dir_util import copy_tree
|
||||||
|
examplespath = os.path.join(os.path.dirname(__file__), "examples")
|
||||||
|
copy_tree(examplespath, self.examplespath)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
RNS.log("Could not copy examples into the "+self.examplespath+" directory.", RNS.LOG_ERROR)
|
||||||
|
RNS.log("The contained exception was: "+str(e), RNS.LOG_ERROR)
|
||||||
|
|
||||||
RNS.log("Could not load config file, creating default configuration file...")
|
RNS.log("Could not load config file, creating default configuration file...")
|
||||||
self.createDefaultConfig()
|
self.createDefaultConfig()
|
||||||
if not os.path.isdir(self.examplespath):
|
|
||||||
os.makedirs(self.examplespath)
|
|
||||||
|
|
||||||
self.firstrun = True
|
self.firstrun = True
|
||||||
|
|
||||||
if os.path.isfile(self.identitypath):
|
if os.path.isfile(self.identitypath):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user