[creepy] 01/01: Rewrite 01-log-to-homedir.patch to make sure ~/.creepy/ is always created before it is used.

Petter Reinholdtsen pere at moszumanska.debian.org
Sun Nov 16 20:30:05 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 e47050aa837b0d3ae4407f9d7ca691a7b39269eb
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Sun Nov 16 21:29:49 2014 +0100

    Rewrite 01-log-to-homedir.patch to make sure ~/.creepy/ is always created before it is used.
---
 debian/patches/01-log-to-homedir.patch | 53 ++++++++++++++++------------------
 1 file changed, 25 insertions(+), 28 deletions(-)

diff --git a/debian/patches/01-log-to-homedir.patch b/debian/patches/01-log-to-homedir.patch
index 9d3e10a..b7f0af1 100644
--- a/debian/patches/01-log-to-homedir.patch
+++ b/debian/patches/01-log-to-homedir.patch
@@ -4,28 +4,11 @@ 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
+index 63121e7..11ad4cc 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
+@@ -35,14 +35,14 @@ from utilities import GeneralUtilities
+ # set up logging
  logger = logging.getLogger(__name__)
  logger.setLevel(logging.DEBUG)
 -fh = logging.FileHandler(os.path.join(os.getcwd(),'creepy_main.log'))
@@ -43,7 +26,7 @@ index 63121e7..c8da303 100644
      _fromUtf8 = QString.fromUtf8
  except AttributeError:
 diff --git a/creepy/models/InputPlugin.py b/creepy/models/InputPlugin.py
-index 99cd990..ef3af25 100644
+index 99cd990..0e1badf 100644
 --- a/creepy/models/InputPlugin.py
 +++ b/creepy/models/InputPlugin.py
 @@ -9,7 +9,7 @@ from utilities import GeneralUtilities
@@ -56,7 +39,7 @@ index 99cd990..ef3af25 100644
  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
+index 7305777..2b6bf26 100644
 --- a/creepy/models/Project.py
 +++ b/creepy/models/Project.py
 @@ -7,7 +7,7 @@ from utilities import GeneralUtilities
@@ -69,7 +52,7 @@ index 7305777..9809013 100644
  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
+index 252391d..287e4c5 100644
 --- a/creepy/plugins/flickr/flickr.py
 +++ b/creepy/plugins/flickr/flickr.py
 @@ -11,7 +11,7 @@ from flickrapi.exceptions import FlickrError
@@ -82,7 +65,7 @@ index 252391d..4ea8786 100644
  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
+index 673ae42..a623de0 100644
 --- a/creepy/plugins/instagram/instagram.py
 +++ b/creepy/plugins/instagram/instagram.py
 @@ -11,7 +11,7 @@ from configobj import ConfigObj
@@ -95,7 +78,7 @@ index 673ae42..9ec0b7d 100644
  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
+index 4cea3da..b4cd9b6 100644
 --- a/creepy/plugins/twitter/twitter.py
 +++ b/creepy/plugins/twitter/twitter.py
 @@ -14,7 +14,7 @@ from configobj import ConfigObj
@@ -108,15 +91,29 @@ index 4cea3da..65a4e9a 100644
  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
+index 5244232..0221507 100644
 --- a/creepy/utilities/GeneralUtilities.py
 +++ b/creepy/utilities/GeneralUtilities.py
-@@ -8,6 +8,9 @@ from math import radians, cos, sin, asin, sqrt
+@@ -1,6 +1,8 @@
+ #!/usr/bin/python
+ # -*- coding: utf-8 -*-
+ from os.path import expanduser
++import os
++import errno
+ import webbrowser
+ from math import radians, cos, sin, asin, sqrt
+ 
+@@ -8,6 +10,14 @@ from math import radians, cos, sin, asin, sqrt
  def getUserHome():
      return expanduser("~")
  
 +def getLogDir():
-+    return expanduser("~/.creepy")
++    logdir = expanduser("~/.creepy")
++    try: os.makedirs(logdir)
++    except OSError as e:
++        if e.errno == errno.EEXIST and os.path.isdir(logdir): pass
++        else: raise
++    return logdir
 +
  def reportProblem():
      webbrowser.open_new_tab('https://github.com/ilektrojohn/creepy/issues')

-- 
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