~ubuntu-branches/ubuntu/saucy/bleachbit/saucy-proposed

« back to all changes in this revision

Viewing changes to bleachbit/Common.py

  • Committer: Package Import Robot
  • Author(s): Luca Falavigna
  • Date: 2012-03-16 21:43:26 UTC
  • mfrom: (1.1.22)
  • Revision ID: package-import@ubuntu.com-20120316214326-c2xssyvjp8mg3o60
Tags: 0.9.2-1
* New upstream release.
 * debian/control:
   - Bump Standards-Version to 3.9.3.
* debian/copyright:
  - Adjust copyright years.
  - Format now points to copyright-format site.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
# -*- coding: UTF-8 -*-
3
3
 
4
4
## BleachBit
5
 
## Copyright (C) 2011 Andrew Ziem
 
5
## Copyright (C) 2012 Andrew Ziem
6
6
## http://bleachbit.sourceforge.net
7
7
##
8
8
## This program is free software: you can redistribute it and/or modify
31
31
if 'nt' == os.name:
32
32
    from win32com.shell import shell, shellcon
33
33
 
34
 
APP_VERSION = "0.9.1"
 
34
APP_VERSION = "0.9.2"
35
35
APP_NAME = "BleachBit"
36
36
APP_URL = "http://bleachbit.sourceforge.net"
37
37
 
131
131
launcher_path = '/usr/share/applications/bleachbit.desktop'
132
132
if 'posix' == os.name:
133
133
    autostart_path = os.path.expanduser('~/.config/autostart/bleachbit.desktop')
134
 
if 'nt' == os.name:
135
 
    autostart_path = os.path.join(shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_STARTUP), 'bleachbit.lnk')
136
134
 
137
135
 
138
136
###
140
138
###
141
139
 
142
140
# Windows XP doesn't define localappdata, but Windows Vista and 7 do
 
141
def environ(varname, csidl):
 
142
    try:
 
143
        os.environ[varname] = shell.SHGetSpecialFolderPath(None, csidl)
 
144
    except:
 
145
        traceback.print_exc()
 
146
        msg = 'Error setting environemnt variable "%s": %s ' % (varname, str(sys.exc_info()[1]))
 
147
        import GuiBasic
 
148
        GuiBasic.message_dialog(None, msg)
143
149
if 'nt' == os.name:
144
 
    if None == os.getenv('localappdata'):
145
 
        os.environ['localappdata'] = shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_LOCAL_APPDATA)
 
150
    environ('localappdata', shellcon.CSIDL_LOCAL_APPDATA)
 
151
    environ('documents', shellcon.CSIDL_DESKTOPDIRECTORY)
146
152
 
147
153
 
148
154
###