Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
from
multiprocessing
import
Process
import
subprocess
import
tempfile
import
getpass
class
KeyGen
:
"""Attributes:
...
...
@@ -110,7 +109,14 @@ class Browser:
self
.
public_key_b64
=
base64
.
b64encode
(
public_key
)
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
()
def
on_navigation_requested
(
self
,
view
,
frame
,
req
,
data
=
None
):
...
...
@@ -128,14 +134,14 @@ class Browser:
except
:
False
def
mount_sshfs_folder
(
self
):
self
.
folder
=
getpass
.
gethome
()
+
"/sshfs"
self
.
folder
=
os
.
path
.
expanduser
(
"~/sshfs"
)
neptun
=
self
.
params
[
"neptun"
]
host
=
self
.
params
[
"host"
]
try
:
os
.
makedirs
(
folder
,
0644
)
os
.
makedirs
(
self
.
folder
,
0644
)
except
:
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
def
umount_sshfs_folder
(
self
):
try
:
...
...
@@ -175,6 +181,7 @@ class Browser:
### JS
self
.
post_key
(
self
.
public_key_b64
)
### Parse values and do mounting ###
elif
uri
.
startswith
(
"https://cloud.ik.bme.hu/?"
):
try
:
uri
,
params
=
uri
.
split
(
'?'
,
1
)
values
=
params
.
split
(
'&'
)
...
...
@@ -185,10 +192,10 @@ class Browser:
self
.
mount_sshfs_folder
()
except
Exception
as
e
:
print
e
finally
:
os
.
unlink
(
self
.
private_key_file
)
except
:
pass
finally
:
os
.
unlink
(
self
.
private_key_file
)
return
True
def
main
(
self
):
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