Comments (5)
Hey cemeyer,
Thanks for such objective review and helping me improve this software. The reason for this whole mess started when I decided to provide a symlink to hotspotd post the installation:
distutils.file_util.copy_file(loc + '/hotspotd/hotspotd.py','/usr/bin/hotspotd',link='sym',preserve_mode=1)
os.chmod(loc + '/hotspotd/hotspotd.py',0755)
You see, this is very much required otherwise, how can the user run sudo hotspotd
without typing the path to entire python library?
Now how do I find the install location (loc variable)? distutils doesn't provide any easy way to do that. Googling led me to these links and I came up with the implemented solution:
http://stackoverflow.com/questions/6362466/install-python-extension-to-specific-location
If you do know abt any way of detecting the install path, please let me know.
The replacement of sys.prefix
with /usr/local
was done in haste to fix bug#1. I guess that can be undone now.
from hotspotd.
I was also prodded along by this python doc page that says on all pure unix systems, the install path is gonna be:
/usr/local/lib/pythonX.Y/site-packages
But apparently it doesn't. Bug #1 arose as the files were installed in dist-packages instead of site-packages
from hotspotd.
Hi Prahlad,
Generally Python binaries whose code lives in site-packages use one of a couple patterns:
- Don't install hotspotd.py in site-packages, instead install it directly in
/usr/bin
Or
- Don't symlink hotspotd from
/usr/bin
but instead create a dummy script that just includeshotspotd
and executeshotspotd.main()
or similar.
Re: Python doc site-packages
link, see the immediately following comment:
Most Linux distributions include Python as a standard part of the system, so prefix and exec-prefix
are usually both /usr on Linux. If you build Python yourself on Linux (or any Unix-like system), the
default prefix and exec-prefix are /usr/local.
I'm not super familiar with Python packaging so I can't help out much more. But this is definitely wrong :-).
from hotspotd.
Hey Conrad,
Many thanks for the useful suggestion about creating a dummy script that just starts
the hotspotd. I came to know that files specified as scripts directly go to the /usr/local/bin
folder. Now the setup code has been reduced to just:
#INSTALL IT
from distutils.core import setup
s = setup(name='hotspotd',
version='0.1',
description='Small daemon to create a wifi hotspot on linux',
license='MIT',
author='Prahlad Yeri',
author_email='[email protected]',
url='https://github.com/prahladyeri/hotspotd',
#py_modules=['hotspotd','cli'],
packages=['hotspotd'],
package_dir={'hotspotd': ''},
package_data={'hotspotd': ['run.dat']},
scripts=['hotspotd']
#data_files=[('config',['run.dat'])],
)
Also, I had considered developing this in C language myself, but went with python for two reasons:
- python code can easily run on multi-architectures without tweaks.
- C seems an overkill (at least for now)
- If at all any need arises for performance, etc. we can always create a C extension or use ctypes in python to call the C library.
Thanks again for your support!
Cheers,
Prahlad
from hotspotd.
Now the setup code has been reduced to just
Great! That looks pretty reasonable.
from hotspotd.
Related Issues (20)
- Start and stop hotspotd from a python script? HOT 8
- Not an issue just a question? HOT 7
- installation failure HOT 1
- prompts "not installed" after succesfull installation on sbc HOT 2
- Refactored version available HOT 1
- Slave Raspberry Pi with Arduino HOT 1
- Works very well! [Adding basic web server] HOT 4
- How to create a hotspot without password? (No password required)? HOT 2
- How can i configure wlan to get internet connection from ethernet? HOT 3
- Does it work on Ubuntu 18.04? HOT 3
- Hotspot not being detected by android phone HOT 3
- Not an issue, a question HOT 5
- Starting hotspotd turns off Wifi Connection HOT 1
- Not an issue, a doubt HOT 1
- Edit the source code HOT 2
- Permission denied !! HOT 1
- Mobile connected to the the network but no internet access HOT 1
- Who the hell doesn't know print() syntax HOT 3
- how to share my vpn connection or socks5 port over hotspot which created by hotspotd? HOT 1
- ModuleNotFoundError: No module named 'cli' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hotspotd.