Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
Nuovo sito
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Milestones
Merge Requests
2
Merge Requests
2
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Nuovo sito
Commits
e9b6c1b3
Commit
e9b6c1b3
authored
Nov 29, 2023
by
shadMod
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added check if py3 version is > 3.8 else use try OSError to copytree
parent
feb5086b
Pipeline
#347
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
uitwww/__init__.py
uitwww/__init__.py
+14
-1
No files found.
uitwww/__init__.py
View file @
e9b6c1b3
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
os
import
os
import
sys
import
flask
import
flask
import
shutil
import
shutil
...
@@ -96,7 +98,18 @@ def init_data_directory(data_path: str):
...
@@ -96,7 +98,18 @@ def init_data_directory(data_path: str):
# Copy news tree dirs and file
# Copy news tree dirs and file
ROOT_NEWS
=
os
.
path
.
join
(
BASE_DIR
,
"assets/news"
)
ROOT_NEWS
=
os
.
path
.
join
(
BASE_DIR
,
"assets/news"
)
NEWS_PATH
=
os
.
path
.
join
(
data_path
,
"news"
)
NEWS_PATH
=
os
.
path
.
join
(
data_path
,
"news"
)
if
sys
.
version_info
[:
2
]
>
(
3
,
8
):
shutil
.
copytree
(
ROOT_NEWS
,
NEWS_PATH
,
dirs_exist_ok
=
True
)
shutil
.
copytree
(
ROOT_NEWS
,
NEWS_PATH
,
dirs_exist_ok
=
True
)
else
:
try
:
# if path already exists, remove it before copying with copytree()
if
os
.
path
.
exists
(
NEWS_PATH
):
shutil
.
rmtree
(
NEWS_PATH
)
shutil
.
copytree
(
ROOT_NEWS
,
NEWS_PATH
)
except
OSError
:
shutil
.
copy
(
ROOT_NEWS
,
NEWS_PATH
)
except
Exception
as
ex
:
print
(
ex
)
# Initialize the cache
# Initialize the cache
static_dirs
=
{
"static"
:
"+assets"
}
static_dirs
=
{
"static"
:
"+assets"
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment