mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Project status (opened / closed)
This commit is contained in:
5 files changed
+40
-8
No files matched your search
@@ -40,12 +40,14 @@ class Project:
|
||||
|
||||
:param project_id: force project identifier (None by default auto generate an UUID)
|
||||
:param path: path of the project. (None use the standard directory)
|
||||
:param status: Status of the project (opened / closed)
|
||||
"""
|
||||
|
||||
def __init__(self, name=None, project_id=None, path=None, controller=None):
|
||||
def __init__(self, name=None, project_id=None, path=None, controller=None, status="opened"):
|
||||
|
||||
self._controller = controller
|
||||
self._name = name
|
||||
self._status = status
|
||||
if project_id is None:
|
||||
self._id = str(uuid4())
|
||||
else:
|
||||
@@ -82,6 +84,10 @@ class Project:
|
||||
def path(self):
|
||||
return self._path
|
||||
|
||||
@property
|
||||
def status(self):
|
||||
return self._status
|
||||
|
||||
@path.setter
|
||||
def path(self, path):
|
||||
check_path_allowed(path)
|
||||
@@ -355,5 +361,6 @@ class Project:
|
||||
return {
|
||||
"name": self._name,
|
||||
"project_id": self._id,
|
||||
"path": self._path
|
||||
"path": self._path,
|
||||
"status": "opened"
|
||||
}
|
||||
Reference in new issue
Block a user