Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
ddb2d75b
authored
Feb 08, 2013
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
laborclient: Fixed home folder
parent
24b3d541
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
7 deletions
+14
-7
miscellaneous/laborclient/cloudgui/gui.py
+14
-7
No files found.
miscellaneous/laborclient/cloudgui/gui.py
View file @
ddb2d75b
...
@@ -10,7 +10,6 @@ import rdp
...
@@ -10,7 +10,6 @@ import rdp
from
multiprocessing
import
Process
from
multiprocessing
import
Process
import
subprocess
import
subprocess
import
tempfile
import
tempfile
import
getpass
class
KeyGen
:
class
KeyGen
:
"""Attributes:
"""Attributes:
...
@@ -110,7 +109,14 @@ class Browser:
...
@@ -110,7 +109,14 @@ class Browser:
self
.
public_key_b64
=
base64
.
b64encode
(
public_key
)
self
.
public_key_b64
=
base64
.
b64encode
(
public_key
)
def
destroy
(
self
,
dummy
):
def
destroy
(
self
,
dummy
):
self
.
umount_sshfs_folder
()
try
:
os
.
unlink
(
self
.
private_key_file
)
except
:
pass
try
:
self
.
umount_sshfs_folder
()
except
:
pass
gtk
.
main_quit
()
gtk
.
main_quit
()
def
on_navigation_requested
(
self
,
view
,
frame
,
req
,
data
=
None
):
def
on_navigation_requested
(
self
,
view
,
frame
,
req
,
data
=
None
):
...
@@ -128,14 +134,14 @@ class Browser:
...
@@ -128,14 +134,14 @@ class Browser:
except
:
except
:
False
False
def
mount_sshfs_folder
(
self
):
def
mount_sshfs_folder
(
self
):
self
.
folder
=
getpass
.
gethome
()
+
"/sshfs"
self
.
folder
=
os
.
path
.
expanduser
(
"~/sshfs"
)
neptun
=
self
.
params
[
"neptun"
]
neptun
=
self
.
params
[
"neptun"
]
host
=
self
.
params
[
"host"
]
host
=
self
.
params
[
"host"
]
try
:
try
:
os
.
makedirs
(
folder
,
0644
)
os
.
makedirs
(
self
.
folder
,
0644
)
except
:
except
:
pass
pass
result
=
subprocess
.
call
([
'/usr/bin/sshfs'
,
'-o'
,
'IdentityFile='
+
self
.
private_key_file
,
neptun
+
"@"
+
host
+
":home"
,
folder
])
result
=
subprocess
.
call
([
'/usr/bin/sshfs'
,
'-o'
,
'IdentityFile='
+
self
.
private_key_file
,
neptun
+
"@"
+
host
+
":home"
,
self
.
folder
])
#print result
#print result
def
umount_sshfs_folder
(
self
):
def
umount_sshfs_folder
(
self
):
try
:
try
:
...
@@ -175,6 +181,7 @@ class Browser:
...
@@ -175,6 +181,7 @@ class Browser:
### JS
### JS
self
.
post_key
(
self
.
public_key_b64
)
self
.
post_key
(
self
.
public_key_b64
)
### Parse values and do mounting ###
### Parse values and do mounting ###
elif
uri
.
startswith
(
"https://cloud.ik.bme.hu/?"
):
try
:
try
:
uri
,
params
=
uri
.
split
(
'?'
,
1
)
uri
,
params
=
uri
.
split
(
'?'
,
1
)
values
=
params
.
split
(
'&'
)
values
=
params
.
split
(
'&'
)
...
@@ -185,10 +192,10 @@ class Browser:
...
@@ -185,10 +192,10 @@ class Browser:
self
.
mount_sshfs_folder
()
self
.
mount_sshfs_folder
()
except
Exception
as
e
:
except
Exception
as
e
:
print
e
print
e
finally
:
os
.
unlink
(
self
.
private_key_file
)
except
:
except
:
pass
pass
finally
:
os
.
unlink
(
self
.
private_key_file
)
return
True
return
True
def
main
(
self
):
def
main
(
self
):
gtk
.
main
()
gtk
.
main
()
...
...
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