mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-27 00:09:50 -05:00
Added dev scripts for launching onionshare and onionshare-gui from the source code tree, without having to install it
This commit is contained in:
parent
4db66a860a
commit
fd41eac48d
4
BUILD.md
4
BUILD.md
@ -20,8 +20,8 @@ sudo apt-get install -y python3-flask python3-stem python3-pyqt5 python-nautilus
|
|||||||
After that you can try both the CLI and the GUI version of OnionShare:
|
After that you can try both the CLI and the GUI version of OnionShare:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./install/scripts/onionshare
|
./dev_scripts/onionshare
|
||||||
./install/scripts/onionshare-gui
|
./dev_scripts/onionshare-gui
|
||||||
```
|
```
|
||||||
|
|
||||||
A script to build a .deb package and install OnionShare easily is also provided for your convenience:
|
A script to build a .deb package and install OnionShare easily is also provided for your convenience:
|
||||||
|
28
dev_scripts/onionshare
Executable file
28
dev_scripts/onionshare
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
OnionShare | https://onionshare.org/
|
||||||
|
|
||||||
|
Copyright (C) 2016 Micah Lee <micah@micahflee.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Load onionshare module and resources from the source code tree
|
||||||
|
import os, sys
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
sys.onionshare_dev_mode = True
|
||||||
|
|
||||||
|
import onionshare
|
||||||
|
onionshare.main()
|
28
dev_scripts/onionshare-gui
Executable file
28
dev_scripts/onionshare-gui
Executable file
@ -0,0 +1,28 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""
|
||||||
|
OnionShare | https://onionshare.org/
|
||||||
|
|
||||||
|
Copyright (C) 2016 Micah Lee <micah@micahflee.com>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
"""
|
||||||
|
|
||||||
|
# Load onionshare module and resources from the source code tree
|
||||||
|
import os, sys
|
||||||
|
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
|
sys.onionshare_dev_mode = True
|
||||||
|
|
||||||
|
import onionshare_gui
|
||||||
|
onionshare_gui.main()
|
@ -34,14 +34,17 @@ def get_resource_path(filename):
|
|||||||
systemwide, and whether regardless of platform
|
systemwide, and whether regardless of platform
|
||||||
"""
|
"""
|
||||||
p = get_platform()
|
p = get_platform()
|
||||||
if p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
|
||||||
|
if getattr(sys, 'onionshare_dev_mode', False):
|
||||||
|
# Look for resources directory relative to python file
|
||||||
|
resources_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'resources')
|
||||||
|
|
||||||
|
elif p == 'Linux' and sys.argv and sys.argv[0].startswith(sys.prefix):
|
||||||
# OnionShare is installed systemwide in Linux
|
# OnionShare is installed systemwide in Linux
|
||||||
resources_dir = os.path.join(sys.prefix, 'share/onionshare')
|
resources_dir = os.path.join(sys.prefix, 'share/onionshare')
|
||||||
elif getattr(sys, 'frozen', False): # Check if app is "frozen" with cx_Freeze
|
elif getattr(sys, 'frozen', False): # Check if app is "frozen" with cx_Freeze
|
||||||
# http://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files
|
# http://cx-freeze.readthedocs.io/en/latest/faq.html#using-data-files
|
||||||
resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
|
resources_dir = os.path.join(os.path.dirname(sys.executable), 'resources')
|
||||||
else: # Look for resources directory relative to python file
|
|
||||||
resources_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))), 'resources')
|
|
||||||
|
|
||||||
return os.path.join(resources_dir, filename)
|
return os.path.join(resources_dir, filename)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user