-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows compatibility changes + Instructions #21
base: master
Are you sure you want to change the base?
Changes from 11 commits
6e90eab
dd81c45
8aaaa94
930ddf0
2edf563
25ae0cb
c236815
e578cf8
4ae950b
7a76f03
4f25439
11302d4
4bdbb15
31668f8
04f0346
552fadc
a829f5c
04b98c3
7c49c6e
075e8d0
e6893a7
4f64a98
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,84 @@ WARNUNG: NOCH IST DIESE SOFTWARE IN ENTWICKLUNG - ALSO NICHT FÜR DEN PRODUKTIVE | |
|
||
Besser als der HSR Mapper ;) | ||
|
||
##How to install | ||
###Ubuntu/Debian | ||
1. Install dependencies | ||
``` | ||
$sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y | ||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hier musst du die Code-Blocks einrücken, da sonst Markdown die Nummerierung nicht Checkout (Siehe https://github.com/seroam/connect/blob/master/README.md) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Und ein Space zwischen |
||
2. Clone repo | ||
``` | ||
$git clone https://github.com/openhsr/connect.git | ||
$cd connect | ||
``` | ||
3. Build & install | ||
``` | ||
$sudo python3 ./setup.py install | ||
``` | ||
4. Set up sync settings | ||
``` | ||
$openhsr-connect edit | ||
``` | ||
Enter HSR information, modify config file for your classes (See example [here](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Generell würde ich Links nicht mit here oder so benennen, sondern bsp. |
||
|
||
5. Profit! | ||
``` | ||
$openhsr-connect sync | ||
``` | ||
Sync the specified directories with the script server. | ||
|
||
|
||
|
||
###Windows | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hier bitte nich einen Hinweis anbringen, dass Windows nicht offiziell/vollständig unterstützt ist. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bitte in |
||
1. Download Python 3.x (Latest is 3.5.2 as of creation of this guide. Download website: [Link](https://www.python.org/downloads/release/python-352/), Installer: [click me hard](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
Install and make sure to install the py launcher as well (this setting should automatically be set in the advanced installation options). | ||
|
||
2. Install git | ||
Download link [here](https://git-scm.com/download/win) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here 😉 |
||
|
||
3. Clone repo | ||
Open admin command prompt | ||
``` | ||
$git clone https://github.com/openhsr/connect.git | ||
cd connect | ||
``` | ||
|
||
4. Build & install | ||
``` | ||
$py -3 setup.py install | ||
``` | ||
|
||
5. Add Python Scripts folder to $PATH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
For x64 Python this path is ```C:\Program Files\Python35\Scripts``` by default. If you're not sure how to add this to Path, check this [link](http://www.computerhope.com/issues/ch000549.htm) | ||
|
||
6. Set up sync settings | ||
``` | ||
$openhsr-connect edit | ||
``` | ||
Enter HSR information, modify config file for your classes (See example [here](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) | ||
|
||
7. Profit! | ||
``` | ||
$openhsr-connect sync | ||
``` | ||
Sync the specified directories with the script server. | ||
|
||
###Bash on Ubuntu on Windows | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wann und was ist hier der Unterschied zur "normalen" Windows?! |
||
Follow steps 1-3 from the Ubuntu/Debian section, then: | ||
|
||
Download & install keyrings.alt | ||
``` | ||
$cd | ||
$curl https://pypi.python.org/packages/27/d0/9207bf58de11735fe2239deaecb9eae1084e2887077a700ac8aa27bd8159/keyrings.alt-1.1.1.tar.gz | tar xz | ||
$cd keyrings.alt-1.1.1 | ||
$sudo python3 ./setup.py install | ||
``` | ||
|
||
Continue with step 4 from the Ubuntu/Debian section. | ||
|
||
|
||
|
||
## Lizenz | ||
|
||
```open\HSR Connect``` steht unter der [GNU Public License version 3 (GPLv3)](https://www.gnu.org/licenses/gpl-3.0.html). Eine Kopie der Lizenz ist unter LICENSE.txt abgelegt. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
import keyring | ||
from .exceptions import PasswordException, ConfigurationException | ||
import jsonschema | ||
import errno | ||
|
||
logger = logging.getLogger('openhsr_connect.config') | ||
PATH_CONFIG = '~/.config/openhsr-connect.yaml' | ||
|
@@ -19,6 +20,7 @@ | |
global-exclude: | ||
- .DS_Store | ||
- Thumbs.db | ||
- desktop.ini | ||
|
||
conflict-handling: | ||
local-changes: ask # ask | keep | overwrite | makeCopy | ||
|
@@ -103,10 +105,24 @@ def create_default_config(config_path): | |
username = input('Dein HSR-Benutzername: ') | ||
mail = input('Deine HSR-Email ([email protected]): ') | ||
config = DEFAULT_CONFIG.format(username=username, mail=mail) | ||
with open(config_path, 'w') as f: | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gemäss PEP-8 nur eine leere Zeile |
||
|
||
with safe_open_w(config_path) as f: | ||
f.write(config) | ||
|
||
|
||
#Open file path and create parent directories if necessary as open() doesn't create them on Windows | ||
def safe_open_w(path): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Python Methodenkommentare sind unterhalb mit drei " def safe_open_w(path):
"""
Open file path and create parent directories if necessary as open() doesn't create them on Windows
""" |
||
try: | ||
os.makedirs(os.path.dirname(path)) | ||
except OSError as e: | ||
if e.errno == errno.EEXIST and os.path.isdir(os.path.dirname(path)): | ||
pass | ||
else: raise | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
return open(path, 'w') | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whitespace bitte löschen |
||
|
||
def load_config(raise_if_incomplete=False): | ||
""" | ||
Loads the user configuration and creates the default configuration if it does not yet exist. | ||
|
@@ -117,6 +133,7 @@ def load_config(raise_if_incomplete=False): | |
if not os.path.exists(config_path): | ||
if raise_if_incomplete: | ||
raise ConfigurationException('Configuration does not yet exist!') | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hier bitte den Whitespace löschen. |
||
create_default_config(config_path) | ||
|
||
config = None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diesen Teil bitte in
/docs/install.md
verschieben. Dort gibt es bereits einen Teil für die Installation des Druckers. Ziel ist es, die Installation mittels Pakete oder Installer zu automatisieren.