removed endtime

This commit is contained in:
Alan Hamlett 2013-09-22 14:56:30 -07:00
parent bd6f454a55
commit d3ac82dfd0
2 changed files with 2 additions and 13 deletions

View file

@ -65,10 +65,6 @@ def parseArguments(argv):
type=float,
help='optional floating-point unix epoch timestamp; '+
'uses current time by default')
parser.add_argument('--endtime', dest='endtime',
help='optional end timestamp turning this action into '+
'a duration; if a non-duration action occurs within a '+
'duration, the duration is ignored')
parser.add_argument('--write', dest='isWrite',
action='store_true',
help='note action was triggered from writing to a file')
@ -124,7 +120,7 @@ def get_user_agent(plugin):
def send_action(project=None, branch=None, stats={}, key=None, targetFile=None,
timestamp=None, endtime=None, isWrite=None, plugin=None, **kwargs):
timestamp=None, isWrite=None, plugin=None, **kwargs):
url = 'https://www.wakati.me/api/v1/actions'
log.debug('Sending action to api at %s' % url)
data = {
@ -135,8 +131,6 @@ def send_action(project=None, branch=None, stats={}, key=None, targetFile=None,
data['lines'] = stats['lines']
if stats.get('language'):
data['language'] = stats['language']
if endtime:
data['endtime'] = endtime
if isWrite:
data['is_write'] = isWrite
if project:

View file

@ -30,9 +30,8 @@ class CustomEncoder(json.JSONEncoder):
class JsonFormatter(logging.Formatter):
def setup(self, timestamp, endtime, isWrite, targetFile, version, plugin):
def setup(self, timestamp, isWrite, targetFile, version, plugin):
self.timestamp = timestamp
self.endtime = endtime
self.isWrite = isWrite
self.targetFile = targetFile
self.version = version
@ -44,14 +43,11 @@ class JsonFormatter(logging.Formatter):
('version', self.version),
('plugin', self.plugin),
('time', self.timestamp),
('endtime', self.endtime),
('isWrite', self.isWrite),
('file', self.targetFile),
('level', record.levelname),
('message', record.msg),
])
if not self.endtime:
del data['endtime']
if not self.plugin:
del data['plugin']
if not self.isWrite:
@ -81,7 +77,6 @@ def setup_logging(args, version):
formatter = JsonFormatter(datefmt='%a %b %d %H:%M:%S %Z %Y')
formatter.setup(
timestamp=args.timestamp,
endtime=args.endtime,
isWrite=args.isWrite,
targetFile=args.targetFile,
version=version,