~oubiwann/ubuntu-accomplishments-system/946850-twisted-app

« back to all changes in this revision

Viewing changes to accomplishments/daemon/api.py

  • Committer: Duncan McGreggor
  • Date: 2012-03-20 00:55:59 UTC
  • Revision ID: duncan@dreamhost.com-20120320005559-yp2k2v27v6b0knvi
Removed unneeded logging setup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
import gobject
13
13
import gpgme
14
14
import json
15
 
import logging
16
15
import os
17
16
import pwd
18
17
import subprocess
250
249
                log.msg("...Not Accomplished")
251
250
            elif exitcode == 2:
252
251
                self.parent.scriptrun_results.append(None)
253
 
                # XXX let's use logging here instead
254
252
                log.msg("....Error")
255
253
            elif exitcode == 4:
256
254
                self.parent.scriptrun_results.append(None)
268
266
        timeend = time.time()
269
267
        timefinal = round((timeend - timestart), 2)
270
268
 
271
 
        # XXX let's use logging here instead
272
 
        print "--- Completed Running Scripts in %.2f seconds ---" % timefinal
273
269
        log.msg(
274
270
            "--- Completed Running Scripts in %.2f seconds---" % timefinal)
275
271
        self.parent.service.scriptrunner_finish()
298
294
        self.asyncapi = AsyncAPI(self)
299
295
 
300
296
        # create config / data dirs if they don't exist
301
 
 
302
297
        self.dir_config = os.path.join(
303
298
            xdg.BaseDirectory.xdg_config_home, "accomplishments")
304
299
        self.dir_data = os.path.join(
315
310
        if not os.path.exists(self.dir_cache):
316
311
            os.makedirs(self.dir_cache)
317
312
 
318
 
        # set up logging
319
 
        logdir = os.path.join(self.dir_cache, "logs")
320
 
 
321
 
        if not os.path.exists(logdir):
322
 
            os.makedirs(logdir)
323
 
 
324
 
        #self.logging = logging
325
 
        logging.basicConfig(
326
 
            filename=(os.path.join(logdir, 'daemon.log')), level=logging.INFO)
327
 
 
328
 
        now = datetime.datetime.now()
329
313
        log.msg(
330
314
            "------------------- Ubuntu Accomplishments Daemon Log - %s "
331
 
            "-------------------", str(now))
 
315
            "-------------------", str(datetime.datetime.now())
332
316
 
333
317
        self._loadConfigFile()
334
318
 
709
693
        else:
710
694
            accompath = os.path.join(homedir, "accomplishments")
711
695
            log.msg("Configuration file not found...creating it!")
712
 
            # XXX let's use logging here instead
713
 
            print "Configuration file not found...creating it!"
714
696
 
715
697
            self.has_verif = False
716
698
            self.accomplishments_path = accompath
942
924
            final = [{item : False}]
943
925
        return final
944
926
 
945
 
 
946
927
    # XXX once the other reference to dbusapi is removed from this file, this
947
928
    # will be the last one. It doesn't really belong here... we can set a whole
948
929
    # slew of dbus api calls on this object when it is instantiated, thus