Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
EasyCloud
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DSDF
EasyCloud
Commits
0603e38b
Commit
0603e38b
authored
4 years ago
by
sguazt
Browse files
Options
Downloads
Patches
Plain Diff
Fixed an import issue.
parent
52fe2803
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
easycloud/core/easycloud.py
+6
-6
6 additions, 6 deletions
easycloud/core/easycloud.py
with
6 additions
and
6 deletions
easycloud/core/easycloud.py
+
6
−
6
View file @
0603e38b
...
...
@@ -6,7 +6,7 @@ from easycloud.core.module import Module
import
easycloud.modules
from
easycloud.tui.simpletui
import
SimpleTUI
import
logging
from
os
import
environ
,
sep
from
os
from
pkgutil
import
iter_modules
import
subprocess
import
sys
...
...
@@ -69,11 +69,11 @@ class EasyCloud:
disclaimer
=
"
\033
[34;1mThis is a proof-of-concept build, not suitable
\n
for production use.
\033
[0m
\n
"
debug_status
=
None
hffr_status
=
None
if
"
LIBCLOUD_DEBUG
"
in
environ
:
if
"
LIBCLOUD_DEBUG
"
in
os
.
environ
:
debug_status
=
"
\033
[93mLibcloud Debug Mode ON
\033
[0m
"
else
:
debug_status
=
"
\033
[90mLibcloud Debug Mode OFF
\033
[0m
"
if
"
LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE
"
in
environ
and
environ
[
"
LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE
"
]
==
"
1
"
:
if
"
LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE
"
in
os
.
environ
and
os
.
environ
[
"
LIBCLOUD_DEBUG_PRETTY_PRINT_RESPONSE
"
]
==
"
1
"
:
hffr_status
=
"
\033
[93mLibcloud Human friendly formatted response ON
\033
[0m
"
else
:
hffr_status
=
"
\033
[90mLibcloud Human friendly formatted response OFF
\033
[0m
"
...
...
@@ -193,7 +193,7 @@ class EasyCloud:
else
:
SimpleTUI
.
msg_dialog
(
"
Library installer
"
,
"
There was an error while installing the missing packages
\n
"
+
"
for
"
+
module
.
platform_name
+
"
.
\n
"
"
Please check
"
+
os
.
pardir
+
os
.
sep
+
"
logs
"
+
sep
+
"
installer.log in the main directory for details.
"
,
SimpleTUI
.
DIALOG_ERROR
)
"
Please check
"
+
os
.
pardir
+
os
.
sep
+
"
logs
"
+
os
.
sep
+
"
installer.log in the main directory for details.
"
,
SimpleTUI
.
DIALOG_ERROR
)
return
False
return
False
return
True
...
...
@@ -211,13 +211,13 @@ class EasyCloud:
"""
subproc
=
subprocess
.
Popen
([
sys
.
executable
,
"
-m
"
,
"
pip
"
,
"
install
"
,
"
--user
"
]
+
pip_libs
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
)
try
:
logfile
=
open
(
os
.
pardir
+
os
.
sep
+
"
logs
"
+
sep
+
"
libs_installer.log
"
,
"
a+
"
)
# open log in append mode
logfile
=
open
(
os
.
pardir
+
os
.
sep
+
"
logs
"
+
os
.
sep
+
"
libs_installer.log
"
,
"
a+
"
)
# open log in append mode
for
line
in
subproc
.
stdout
:
# write the subprocess stdout to the log file
logfile
.
write
(
line
.
decode
(
sys
.
stdout
.
encoding
))
logfile
.
close
()
except
IOError
as
e
:
logging
.
error
(
"
IO Error while trying to write data on
"
+
os
.
pardir
+
os
.
sep
+
"
logs
"
+
sep
+
"
libs_installer.log:
"
+
str
(
e
))
logging
.
error
(
"
IO Error while trying to write data on
"
+
os
.
pardir
+
os
.
sep
+
"
logs
"
+
os
.
sep
+
"
libs_installer.log:
"
+
str
(
e
))
subproc
.
wait
()
if
subproc
.
returncode
:
# raise an exception if the installation encountered a problem
return
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment