From 6e90eab50e29d10a7f4e95a23e913991c713ddf4 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Mon, 28 Nov 2016 20:49:39 +0100 Subject: [PATCH 01/22] Add desktop.ini to global-exclude in default config to .DS_Store) --- openhsr_connect/configuration.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openhsr_connect/configuration.py b/openhsr_connect/configuration.py index bbe6fb4..4d123c3 100644 --- a/openhsr_connect/configuration.py +++ b/openhsr_connect/configuration.py @@ -19,6 +19,7 @@ global-exclude: - .DS_Store - Thumbs.db + - desktop.ini conflict-handling: local-changes: ask # ask | keep | overwrite | makeCopy From dd81c459caaba10581cce7f2bd3f936747119bb6 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Mon, 28 Nov 2016 23:43:46 +0100 Subject: [PATCH 02/22] Add function safe_open_w in configuration.py to create parent directory of config because open() doesn't do that on Windows. --- openhsr_connect/configuration.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/openhsr_connect/configuration.py b/openhsr_connect/configuration.py index 4d123c3..8a0f2c9 100644 --- a/openhsr_connect/configuration.py +++ b/openhsr_connect/configuration.py @@ -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' @@ -104,10 +105,24 @@ def create_default_config(config_path): username = input('Dein HSR-Benutzername: ') mail = input('Deine HSR-Email (VORNAME.NACHNAME@hsr.ch): ') config = DEFAULT_CONFIG.format(username=username, mail=mail) - with open(config_path, 'w') as f: + + + 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): + try: + os.makedirs(path) + except OSError as e: + if e.errno == errno.EEXIST and os.path.isdir(path): + pass + else: raise + + return open(path, 'w') + + def load_config(raise_if_incomplete=False): """ Loads the user configuration and creates the default configuration if it does not yet exist. @@ -118,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!') + create_default_config(config_path) config = None From 8aaaa9460d8a49c060c2bd242f37894f99738279 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Mon, 28 Nov 2016 23:54:19 +0100 Subject: [PATCH 03/22] Fix in safe_open_w --- openhsr_connect/configuration.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhsr_connect/configuration.py b/openhsr_connect/configuration.py index 8a0f2c9..c066195 100644 --- a/openhsr_connect/configuration.py +++ b/openhsr_connect/configuration.py @@ -114,9 +114,9 @@ def create_default_config(config_path): #Open file path and create parent directories if necessary as open() doesn't create them on Windows def safe_open_w(path): try: - os.makedirs(path) + os.makedirs(os.path.dirname(path)) except OSError as e: - if e.errno == errno.EEXIST and os.path.isdir(path): + if e.errno == errno.EEXIST and os.path.isdir(os.path.dirname(path)): pass else: raise From 930ddf0a0ab87386f2285ce73db546562f5bdf7e Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Tue, 29 Nov 2016 01:26:22 +0100 Subject: [PATCH 04/22] Modify docs/config.example.yaml for better example, included desktop.ini in global-excludes --- docs/config.example.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/config.example.yaml b/docs/config.example.yaml index 4739515..4041c84 100644 --- a/docs/config.example.yaml +++ b/docs/config.example.yaml @@ -6,12 +6,13 @@ sync: global-exclude: - .DS_Store - Thumbs.db + - desktop.ini conflict-handling: local-changes: ask remote-deleted: ask - default-local-dir: /path/to/your/files// + default-local-dir: /path/to/your/files// #E.g. /home/user/hsr// repositories: InfSi1: @@ -19,3 +20,6 @@ sync: exclude: - '*.exe' - 'Archiv' + OO: + remote-dir: Informatik\Fachbereich\Objektorientierte_Programmierung\OO + From 2edf563898566a584ca3c523c459d19f6685e023 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Tue, 29 Nov 2016 01:27:24 +0100 Subject: [PATCH 05/22] Add 'How to install' for Ubuntu/Debian section to README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index 938049b..fea3bb3 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,27 @@ 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``` + +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/seroam/connect/blob/master/docs/config.example.yaml) + ## 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. From 25ae0cb2aec47c4a483dd7a4befa91914435ed32 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Tue, 29 Nov 2016 01:29:38 +0100 Subject: [PATCH 06/22] Edit formatting of How to install --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fea3bb3..298d4f9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ 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``` +``` +$sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y +``` 2. Clone repo ``` @@ -18,6 +20,7 @@ $cd connect 3. Build & install ``` $sudo python3 ./setup.py install +``` 4. Set up sync settings ``` From c236815fe17e2341c2129dd40931f2b87c6aa004 Mon Sep 17 00:00:00 2001 From: SeRoaM Date: Tue, 29 Nov 2016 01:30:49 +0100 Subject: [PATCH 07/22] Edit text of README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 298d4f9..6d88786 100644 --- a/README.md +++ b/README.md @@ -10,23 +10,20 @@ Besser als der HSR Mapper ;) ``` $sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y ``` - 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/seroam/connect/blob/master/docs/config.example.yaml) +Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/connect/blob/master/docs/config.example.yaml)) ## Lizenz From e578cf8a10b0dda236767401b81d6974c61cbaf4 Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 01:33:02 +0100 Subject: [PATCH 08/22] Edit text README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 6d88786..23d9085 100644 --- a/README.md +++ b/README.md @@ -13,8 +13,7 @@ $sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-d 2. Clone repo ``` $git clone https://github.com/openhsr/connect.git -$cd connect -``` +$cd connect``` 3. Build & install ``` $sudo python3 ./setup.py install From 4ae950bc42dbae414601280c6b281d8c345b9bf3 Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 01:46:59 +0100 Subject: [PATCH 09/22] Add 'How to install' Windows part --- README.md | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 23d9085..466cab3 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,8 @@ $sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-d 2. Clone repo ``` $git clone https://github.com/openhsr/connect.git -$cd connect``` +$cd connect +``` 3. Build & install ``` $sudo python3 ./setup.py install @@ -24,6 +25,35 @@ $openhsr-connect edit ``` Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/connect/blob/master/docs/config.example.yaml)) +###Windows +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)) +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) + +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 +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/seroam/connect/blob/master/docs/config.example.yaml)) + + ## 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. From 7a76f035c002169b8540de0ad605c5647351cc48 Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 01:54:21 +0100 Subject: [PATCH 10/22] Add 'Bash on Ubuntu on Windows' section, Text fixes --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index 466cab3..0cff14e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ $openhsr-connect edit ``` Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/connect/blob/master/docs/config.example.yaml)) +5. Profit! +``` +$openhsr-connect sync +``` +Sync the specified directories with the script server. + + + ###Windows 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)) Install and make sure to install the py launcher as well (this setting should automatically be set in the advanced installation options). @@ -53,6 +61,26 @@ $openhsr-connect edit ``` Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/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 +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 From 4f25439a9376c2acd8621cbc66b43bccd1264195 Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 02:18:59 +0100 Subject: [PATCH 11/22] Change links from seroam to openhsr --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0cff14e..cb9fa17 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ $sudo python3 ./setup.py install ``` $openhsr-connect edit ``` -Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/connect/blob/master/docs/config.example.yaml)) +Enter HSR information, modify config file for your classes (See example [here](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) 5. Profit! ``` @@ -59,7 +59,7 @@ For x64 Python this path is ```C:\Program Files\Python35\Scripts``` by default. ``` $openhsr-connect edit ``` -Enter HSR information, modify config file for your classes (See example [here](https://github.com/seroam/connect/blob/master/docs/config.example.yaml)) +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! ``` From 11302d47877d3b657ad0f05ca5f79e0c835de613 Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 16:57:47 +0100 Subject: [PATCH 12/22] Add section macOS to installation guides --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index cb9fa17..ab774b2 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,41 @@ $openhsr-connect sync Sync the specified directories with the script server. +###macOS +1. Install Homebrew +``` +$/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +``` + +2. Install Python 3 +``` +$brew install python3 +``` + +3. Clone repo +``` +$git clone https://github.com/openhsr/connect.git +$cd connect +``` + +4. Build & install +``` +$python3 ./setup.py install +``` + +5. 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)) +If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. + +6. Profit! +``` +$openhsr-connect sync +``` +Sync the specified directories with the script server. + ###Windows 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)) From 4bdbb157ee149dc1a7e226c6c6ddd00659d7f96c Mon Sep 17 00:00:00 2001 From: seroam Date: Tue, 29 Nov 2016 17:04:35 +0100 Subject: [PATCH 13/22] Add missing '$' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab774b2..3f36b22 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Download link [here](https://git-scm.com/download/win) Open admin command prompt ``` $git clone https://github.com/openhsr/connect.git -cd connect +$cd connect ``` 4. Build & install From 31668f8a63b73472d884ec1e3564b9e51b83e2ce Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 17:24:52 +0100 Subject: [PATCH 14/22] Add spaces for enumeration --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3f36b22..b33cd2e 100644 --- a/README.md +++ b/README.md @@ -7,9 +7,11 @@ 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 -``` + + ``` + $sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y + ``` + 2. Clone repo ``` $git clone https://github.com/openhsr/connect.git From 04f0346536d1ef6e41498ddcb89adc66c64f2670 Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:24:24 +0100 Subject: [PATCH 15/22] Add more spaces for enumeration --- README.md | 156 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 93 insertions(+), 63 deletions(-) diff --git a/README.md b/README.md index b33cd2e..0938c84 100644 --- a/README.md +++ b/README.md @@ -9,111 +9,141 @@ Besser als der HSR Mapper ;) 1. Install dependencies ``` - $sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y + $ sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y ``` 2. Clone repo -``` -$git clone https://github.com/openhsr/connect.git -$cd connect -``` + + ``` + $ git clone https://github.com/openhsr/connect.git + $ cd connect + ``` + 3. Build & install -``` -$sudo python3 ./setup.py install -``` + + ``` + $ sudo python3 ./setup.py install + ``` + 4. Set up sync settings -``` -$openhsr-connect edit -``` + + ``` + $ 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)) 5. Profit! -``` -$openhsr-connect sync -``` + + ``` + $ openhsr-connect sync + ``` + Sync the specified directories with the script server. ###macOS 1. Install Homebrew -``` -$/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -``` + + ``` + $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` + 2. Install Python 3 -``` -$brew install python3 -``` + + ``` + $ brew install python3 + ``` 3. Clone repo -``` -$git clone https://github.com/openhsr/connect.git -$cd connect -``` + ``` + $ git clone https://github.com/openhsr/connect.git + $ cd connect + ``` + + 4. Build & install -``` -$python3 ./setup.py install -``` + ``` + $ python3 ./setup.py install + ``` + + 5. 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)) -If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. + + ``` + $ 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)) + If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. 6. Profit! -``` -$openhsr-connect sync -``` -Sync the specified directories with the script server. + + ``` + $ openhsr-connect sync + ``` + + Sync the specified directories with the script server. ###Windows -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)) -Install and make sure to install the py launcher as well (this setting should automatically be set in the advanced installation options). + 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)) + 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) + 2. Install git + Download link [here](https://git-scm.com/download/win) 3. Clone repo -Open admin command prompt -``` -$git clone https://github.com/openhsr/connect.git -$cd connect -``` + Open admin command prompt + + ``` + $ git clone https://github.com/openhsr/connect.git + $ cd connect + ``` + 4. Build & install -``` -$py -3 setup.py install -``` + + ``` + $ py -3 setup.py install + ``` + 5. Add Python Scripts folder to $PATH -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) + 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)) + + ``` + $ 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. + + ``` + $ openhsr-connect sync + ``` + + Sync the specified directories with the script server. ###Bash on Ubuntu on Windows +It's probably easier to just use it in Windows if you're on Windows but here's how you'd get it to work on BoUoW: + 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 -``` + + ``` + $ 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. From 552fadc168db7e9d519f5eb7a00ae6cdbb5758db Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:29:29 +0100 Subject: [PATCH 16/22] Change link format --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0938c84..3482c62 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Besser als der HSR Mapper ;) $ 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)) +Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) 5. Profit! @@ -43,7 +43,7 @@ Sync the specified directories with the script server. ###macOS -1. Install Homebrew +1. Install [Homebrew](http://brew.sh/) ``` $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" @@ -77,7 +77,7 @@ Sync the specified directories with the script server. $ 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)) + Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. 6. Profit! @@ -89,12 +89,12 @@ Sync the specified directories with the script server. Sync the specified directories with the script server. -###Windows - 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)) +###Windows (Not officially supported) + 1. Download Python 3.x (Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) 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) + [Download link](https://git-scm.com/download/win) 3. Clone repo Open admin command prompt @@ -131,7 +131,7 @@ Sync the specified directories with the script server. Sync the specified directories with the script server. -###Bash on Ubuntu on Windows +###Bash on Ubuntu on Windows (Not officially supported) It's probably easier to just use it in Windows if you're on Windows but here's how you'd get it to work on BoUoW: Follow steps 1-3 from the Ubuntu/Debian section, then: From a829f5c5667ad4fbd80ba9e3e8bd72c1c72320c3 Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:36:34 +0100 Subject: [PATCH 17/22] Change formatting --- openhsr_connect/configuration.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/openhsr_connect/configuration.py b/openhsr_connect/configuration.py index c066195..33caeb1 100644 --- a/openhsr_connect/configuration.py +++ b/openhsr_connect/configuration.py @@ -111,15 +111,18 @@ def create_default_config(config_path): 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): + """ + 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 - + else: + raise + return open(path, 'w') @@ -133,7 +136,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!') - + create_default_config(config_path) config = None From 04b98c344f299a8bcb458673c725a442a8ac2ecd Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:40:23 +0100 Subject: [PATCH 18/22] Edit formatting --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3482c62..ca9bb1c 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Besser als der HSR Mapper ;) $ openhsr-connect edit ``` -Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) + Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) 5. Profit! @@ -39,7 +39,7 @@ Enter HSR information, modify config file for your classes ([See example configu $ openhsr-connect sync ``` -Sync the specified directories with the script server. + Sync the specified directories with the script server. ###macOS @@ -113,7 +113,7 @@ Sync the specified directories with the script server. 5. Add Python Scripts folder to $PATH - 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) + 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 @@ -138,12 +138,12 @@ 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 - ``` +``` +$ 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. From 7c49c6e5d80f2d0bc5f0b623365082aca95e2b56 Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:44:18 +0100 Subject: [PATCH 19/22] Edit formatting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ca9bb1c..f572665 100644 --- a/README.md +++ b/README.md @@ -90,10 +90,10 @@ Besser als der HSR Mapper ;) ###Windows (Not officially supported) - 1. Download Python 3.x (Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) +1. Download Python 3.x (Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) 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 +2. Install git [Download link](https://git-scm.com/download/win) 3. Clone repo From 075e8d0d8d3b641f514c78bb1b5bbe4bc56402e4 Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:45:48 +0100 Subject: [PATCH 20/22] Edit formatting --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f572665..1990326 100644 --- a/README.md +++ b/README.md @@ -90,13 +90,17 @@ Besser als der HSR Mapper ;) ###Windows (Not officially supported) -1. Download Python 3.x (Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) +1. Download Python 3.x + + Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) 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](https://git-scm.com/download/win) 3. Clone repo + Open admin command prompt ``` @@ -113,6 +117,7 @@ Besser als der HSR Mapper ;) 5. Add Python Scripts folder to $PATH + 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 From e6893a7b873ac3ece690fb2df01936293ed2b276 Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:53:26 +0100 Subject: [PATCH 21/22] Move install section to docs/install.md --- README.md | 150 ---------------------------------------------- docs/install.md | 154 +++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 153 insertions(+), 151 deletions(-) diff --git a/README.md b/README.md index 1990326..938049b 100644 --- a/README.md +++ b/README.md @@ -4,156 +4,6 @@ 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 - ``` - -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 configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) - -5. Profit! - - ``` - $ openhsr-connect sync - ``` - - Sync the specified directories with the script server. - - -###macOS -1. Install [Homebrew](http://brew.sh/) - - ``` - $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ``` - - -2. Install Python 3 - - ``` - $ brew install python3 - ``` - -3. Clone repo - - ``` - $ git clone https://github.com/openhsr/connect.git - $ cd connect - ``` - - -4. Build & install - - ``` - $ python3 ./setup.py install - ``` - - -5. Set up sync settings - - ``` - $ openhsr-connect edit - ``` - - Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) - If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. - -6. Profit! - - ``` - $ openhsr-connect sync - ``` - - Sync the specified directories with the script server. - - -###Windows (Not officially supported) -1. Download Python 3.x - - Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) - 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](https://git-scm.com/download/win) - -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 - - 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 (Not officially supported) -It's probably easier to just use it in Windows if you're on Windows but here's how you'd get it to work on BoUoW: - -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. diff --git a/docs/install.md b/docs/install.md index a26323d..26c025a 100644 --- a/docs/install.md +++ b/docs/install.md @@ -9,6 +9,43 @@ Führe folgende Befehle als root aus! ## Für Linux-Distributionen: +###Sync +1. Install dependencies + + ``` + $ sudo apt-get install git python3-setuptools gcc python3-dev libffi-dev libssl-dev python3-pip -y + ``` + +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 configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) + +5. Profit! + + ``` + $ openhsr-connect sync + ``` + + Sync the specified directories with the script server. + + ### Drucker Damit CUPS das E-Mail-Backend nutzen kann muss dieses verlinkt werden. @@ -42,7 +79,55 @@ if [ $? -eq 0 ]; then lpadmin -x openhsr-connect fi ``` -## Für Mac OS X: +## Für macOS: + +### Sync + +1. Install [Homebrew](http://brew.sh/) + + ``` + $/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` + + +2. Install Python 3 + + ``` + $ brew install python3 + ``` + +3. Clone repo + + ``` + $ git clone https://github.com/openhsr/connect.git + $ cd connect + ``` + + +4. Build & install + + ``` + $ python3 ./setup.py install + ``` + + +5. Set up sync settings + + ``` + $ openhsr-connect edit + ``` + + Enter HSR information, modify config file for your classes ([See example configuration](https://github.com/openhsr/connect/blob/master/docs/config.example.yaml)) + If you get a decoding error and the application crashes after entering your email address, make sure you have your encoding set to 'Western (ISO Latin 1)' and not UTF-8. You can change this setting under Terminal->Preferences->Profiles->Advanced->Text encoding. + +6. Profit! + + ``` + $ openhsr-connect sync + ``` + + Sync the specified directories with the script server. + ### Drucker Damit CUPS das E-Mail-Backend nutzen kann muss dieses verlinkt werden. ```bash @@ -75,3 +160,70 @@ if [ $? -eq 0 ]; then lpadmin -x openhsr-connect fi ``` + +##Für Windows (Not officially supported) + +### Sync +1. Download Python 3.x + + Latest is 3.5.2 as of creation of this guide. [Download website](https://www.python.org/downloads/release/python-352/), [Installer](https://www.python.org/ftp/python/3.5.2/python-3.5.2-amd64.exe)) + 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](https://git-scm.com/download/win) + +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 + + 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 (Not officially supported) +### Sync +It's probably easier to just use it in Windows if you're on Windows but here's how you'd get it to work on BoUoW: + +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. + From 4f64a98fe2cbf7d2eb67e0b267ffd980611312dc Mon Sep 17 00:00:00 2001 From: Severin Marti Date: Mon, 12 Dec 2016 19:55:08 +0100 Subject: [PATCH 22/22] Text fix --- docs/install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.md b/docs/install.md index 26c025a..f047ecd 100644 --- a/docs/install.md +++ b/docs/install.md @@ -225,5 +225,5 @@ $ cd keyrings.alt-1.1.1 $ sudo python3 ./setup.py install ``` -Continue with step 4 from the Ubuntu/Debian section. +Continue with step 4 from the Linux-Distributionen section.