From da74592ac4922146ab7e57dc74d6cd8a4eeb41a3 Mon Sep 17 00:00:00 2001 From: Alan Hamlett Date: Thu, 12 Feb 2015 18:36:14 -0800 Subject: [PATCH] update readme with config file available settings. support setting proxy from config file. --- README.rst | 44 +++++++++++++++++++++++++++++++++++++------- wakatime/__init__.py | 2 ++ 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 804a49c..a6938ab 100644 --- a/README.rst +++ b/README.rst @@ -8,13 +8,43 @@ This is the common interface for the WakaTime api. You shouldn't need to directl Go to http://wakatime.com to install the plugin for your text editor. -Installation ------------- - - pip install wakatime - - Usage ----- -https://wakatime.com/ +Install the plugin for your IDE/editor at https://wakatime.com/plugins + +If you are building a plugin using the [WakaTime API](https://wakatime.com/developers/) +then follow the [Creating a Plugin](https://wakatime.com/help/misc/creating-plugin) +guide for information about using `wakatime-cli.py`. + + +Configuring +----------- + +Options can be passed via command line, or set in the `$HOME/.wakatime.cfg` +config file. Command line arguments take precedence over config file settings. +The `$HOME/.wakatime.cfg` file is in [INI](http://en.wikipedia.org/wiki/INI_file) +format. An example config file looks like: + +``` +[settings] +debug = false +api_key = your-api-key +hidefilenames = false +ignore = + ^COMMIT_EDITMSG$ + ^TAG_EDITMSG$ + ^/var/ + ^/etc/ +offline = true +proxy = https://user:pass@localhost:8080 +``` + + +Installation +------------ + +Each plugin installs wakatime for you, but for testing you can install the +common api interface with pip: + + pip install wakatime diff --git a/wakatime/__init__.py b/wakatime/__init__.py index 72dbcf7..4cf4506 100644 --- a/wakatime/__init__.py +++ b/wakatime/__init__.py @@ -215,6 +215,8 @@ def parseArguments(argv): args.offline = configs.getboolean('settings', 'offline') if not args.hidefilenames and configs.has_option('settings', 'hidefilenames'): args.hidefilenames = configs.getboolean('settings', 'hidefilenames') + if not args.proxy and configs.has_option('settings', 'proxy'): + args.proxy = configs.get('settings', 'proxy') if not args.verbose and configs.has_option('settings', 'verbose'): args.verbose = configs.getboolean('settings', 'verbose') if not args.verbose and configs.has_option('settings', 'debug'):