Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
PEP8 entrypoint script
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 21, 2013
1 parent 0a095b8 commit 79aa339
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions bin/synoptic
@@ -1,5 +1,6 @@
#! /usr/bin/env python2.5


def get_data_path():
import os.path

Expand All @@ -15,24 +16,22 @@ def get_data_path():
return synoptic_path




class Log:
"""file-like for writes with auto flush after each write
to ensure that everything is logged, even during an
unexpected exit."""

def __init__(self, f):
self.f = f

def write(self, s):
self.f.write(s)
self.f.flush()

def flush(self):
self.f.flush()




def main():
from optparse import OptionParser

Expand All @@ -42,8 +41,9 @@ def main():
mydir = get_data_path()

description = ("An AJAXy information/note manager * "
"To start a new database file, simply pick a file name and start synoptic "
"with it. That file will be created and will contain your set of notes.")
"To start a new database file, simply pick a file name and start "
"synoptic with it. That file will be created and will contain your "
"set of notes.")

parser = OptionParser(description=description,
usage="%prog [options] dbfile")
Expand Down Expand Up @@ -145,7 +145,7 @@ def main():
if pid > 0:
# exit from second parent, print eventual PID before
#print "Daemon PID %d" % pid
open(options.pidfile,'w').write("%d"%pid)
open(options.pidfile, 'w').write("%d" % pid)
sys.exit(0)
except OSError, e:
print >>sys.stderr, "fork #2 failed: %d (%s)" % (e.errno, e.strerror)
Expand Down Expand Up @@ -174,4 +174,3 @@ def main():

if __name__ == "__main__":
main()

0 comments on commit 79aa339

Please sign in to comment.