#!/usr/bin/env python
# vim: set expandtab sw=4 ts=4:
# Generate a read key for Keen.io trends
# Usage : get_read_key.py project_name
#
# Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
#
# This file is part of buildtime-trend
# <https://github.com/ruleant/buildtime-trend/>
#
# 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
# 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/>.

from buildtimetrend.keenio import keen_io_generate_read_key
import sys


def get_read_key():
    '''
    Generate a read key for the project and print that key
    '''
    # define projectname
    # fe. project_name = "ruleant/buildtime-trend"
    project_name = "projectname"

    # get project name from argument
    if len(sys.argv) > 1:
        project_name = sys.argv[1]

    # generate a read key
    print keen_io_generate_read_key(project_name)

if __name__ == "__main__":
    get_read_key()

@@ -47,18 +47,20 @@
 4 ts=4:%0A
-# 
+'''%0A
 Generate
@@ -87,17 +87,13 @@
 .io 
-trends%0A# 
+API%0A%0A
 Usag
@@ -112,16 +112,17 @@
 _key.py 
+%5B
 project_
@@ -125,21 +125,175 @@
 ect_name
-%0A#%0A# 
+%5D%0A%0AWhen argument project_name is used, the read key will be%0Agenerated to access this project.%0AIf no argument is given, the default project name will be used.%0A%0A
 Copyrigh
@@ -355,20 +355,17 @@
 ge.net%3E%0A
-#%0A# 
+%0A
 This fil
@@ -393,18 +393,16 @@
 e-trend%0A
-# 
 %3Chttps:/
@@ -439,20 +439,17 @@
 trend/%3E%0A
-#%0A# 
+%0A
 This pro
@@ -509,18 +509,16 @@
  modify%0A
-# 
 it under
@@ -578,18 +578,16 @@
 shed by%0A
-# 
 the Free
@@ -644,18 +644,16 @@
 nse, or%0A
-# 
 any late
@@ -663,20 +663,17 @@
 ersion.%0A
-#%0A# 
+%0A
 This pro
@@ -728,18 +728,16 @@
 useful,%0A
-# 
 but WITH
@@ -791,18 +791,16 @@
 anty of%0A
-# 
 MERCHANT
@@ -852,18 +852,16 @@
 See the%0A
-# 
 GNU Gene
@@ -901,12 +901,9 @@
 ls.%0A
-#%0A# 
+%0A
 You 
@@ -964,18 +964,16 @@
 License%0A
-# 
 along wi
@@ -1032,16 +1032,20 @@
 enses/%3E.
+%0A'''
 %0A%0Afrom b

improve module comment