[creepy] 01/01: Add patch 01-log-to-homedir.patch to rewrite log code to log to ~/.creepy/, not ~/ or /usr/share/creepy/.

Petter Reinholdtsen pere at moszumanska.debian.org
Sun Nov 16 19:27:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository creepy.

commit fc081d49f18bace9c9c08fc624f3baf60523e790
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sun Nov 16 20:26:53 2014 +0100

    Add patch 01-log-to-homedir.patch to rewrite log code to log to ~/.creepy/, not ~/ or /usr/share/creepy/.
---
 debian/changelog                       |   2 +
 debian/patches/01-log-to-homedir.patch | 123 +++++++++++++++++++++++++++++++++
 debian/patches/series                  |   1 +
 3 files changed, 126 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index a5b069e..8b91494 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -13,6 +13,8 @@ creepy (1.2~alpha-1) UNRELEASED; urgency=medium
     1.94-1.watch
   * Update to upstream version 1.2~alpha.
   * Add new dependency python-qt4 to get GUI working.
+  * Add patch 01-log-to-homedir.patch to rewrite log code to log to
+    ~/.creepy/, not ~/ or /usr/share/creepy/.
 
  -- Andreas Tille <tille at debian.org>  Sun, 16 Feb 2014 11:46:28 +0100
 
diff --git a/debian/patches/01-log-to-homedir.patch b/debian/patches/01-log-to-homedir.patch
new file mode 100644
index 0000000..9d3e10a
--- /dev/null
+++ b/debian/patches/01-log-to-homedir.patch
@@ -0,0 +1,123 @@
+Description: Log to created ~/.creepy/ directory, not /usr/share/
+Author: Petter Reinholdtsen <pere at hungry.com>
+Reviewed-By: Petter Reinholdtsen <pere at hungry.com>
+Last-Update: 2014-11-16
+
+diff --git a/creepy/CreepyMain.py b/creepy/CreepyMain.py
+index 63121e7..c8da303 100644
+--- a/creepy/CreepyMain.py
++++ b/creepy/CreepyMain.py
+@@ -3,6 +3,7 @@
+ import sys
+ import datetime
+ import os
++import errno
+ import logging
+ import shelve
+ import functools
+@@ -32,17 +33,22 @@ from components.AboutDialog import AboutDialog
+ from components.VerifyDeleteDialog import VerifyDeleteDialog
+ from components.UpdateCheckDialog import UpdateCheckDialog
+ from utilities import GeneralUtilities
+-# set up logging
++# set up logging, first make sure the log directory exist
++logdir = GeneralUtilities.getLogDir()
++try: os.makedirs(logdir)
++except OSError as e:
++    if e.errno == errno.EEXIST and os.path.isdir(logdir): pass
++    else: raise
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(os.getcwd(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+ logger.addHandler(fh)
+ #Capture stderr and stdout to a file
+-sys.stdout = open(os.path.join(os.getcwd(),'creepy_stdout.log'), 'w')
+-sys.stderr = open(os.path.join(os.getcwd(),'creepy_stderr.log'), 'w')
++sys.stdout = open(os.path.join(GeneralUtilities.getLogDir(),'creepy_stdout.log'), 'w')
++sys.stderr = open(os.path.join(GeneralUtilities.getLogDir(),'creepy_stderr.log'), 'w')
+ try:
+     _fromUtf8 = QString.fromUtf8
+ except AttributeError:
+diff --git a/creepy/models/InputPlugin.py b/creepy/models/InputPlugin.py
+index 99cd990..ef3af25 100644
+--- a/creepy/models/InputPlugin.py
++++ b/creepy/models/InputPlugin.py
+@@ -9,7 +9,7 @@ from utilities import GeneralUtilities
+ #set up logging
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(GeneralUtilities.getUserHome(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+diff --git a/creepy/models/Project.py b/creepy/models/Project.py
+index 7305777..9809013 100644
+--- a/creepy/models/Project.py
++++ b/creepy/models/Project.py
+@@ -7,7 +7,7 @@ from utilities import GeneralUtilities
+ # set up logging
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(GeneralUtilities.getUserHome(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+diff --git a/creepy/plugins/flickr/flickr.py b/creepy/plugins/flickr/flickr.py
+index 252391d..4ea8786 100644
+--- a/creepy/plugins/flickr/flickr.py
++++ b/creepy/plugins/flickr/flickr.py
+@@ -11,7 +11,7 @@ from flickrapi.exceptions import FlickrError
+ #set up logging
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(os.getcwdu(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+diff --git a/creepy/plugins/instagram/instagram.py b/creepy/plugins/instagram/instagram.py
+index 673ae42..9ec0b7d 100644
+--- a/creepy/plugins/instagram/instagram.py
++++ b/creepy/plugins/instagram/instagram.py
+@@ -11,7 +11,7 @@ from configobj import ConfigObj
+ #set up logging
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(os.getcwdu(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+diff --git a/creepy/plugins/twitter/twitter.py b/creepy/plugins/twitter/twitter.py
+index 4cea3da..65a4e9a 100644
+--- a/creepy/plugins/twitter/twitter.py
++++ b/creepy/plugins/twitter/twitter.py
+@@ -14,7 +14,7 @@ from configobj import ConfigObj
+ #set up logging
+ logger = logging.getLogger(__name__)
+ logger.setLevel(logging.DEBUG)
+-fh = logging.FileHandler(os.path.join(os.getcwd(),'creepy_main.log'))
++fh = logging.FileHandler(os.path.join(GeneralUtilities.getLogDir(),'creepy_main.log'))
+ fh.setLevel(logging.DEBUG)
+ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
+ fh.setFormatter(formatter)
+diff --git a/creepy/utilities/GeneralUtilities.py b/creepy/utilities/GeneralUtilities.py
+index 5244232..84618a8 100644
+--- a/creepy/utilities/GeneralUtilities.py
++++ b/creepy/utilities/GeneralUtilities.py
+@@ -8,6 +8,9 @@ from math import radians, cos, sin, asin, sqrt
+ def getUserHome():
+     return expanduser("~")
+ 
++def getLogDir():
++    return expanduser("~/.creepy")
++
+ def reportProblem():
+     webbrowser.open_new_tab('https://github.com/ilektrojohn/creepy/issues')
+     
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..93fcf1f
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+01-log-to-homedir.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/creepy.git



More information about the Pkg-grass-devel mailing list