Compare commits

..

10 Commits
1.6.0 ... 1.6.5

Author SHA1 Message Date
4adb8a8796 v1.6.5 2014-03-05 13:55:08 -08:00
48e1993b24 upgrade external wakatime package to v1.0.1 2014-03-05 13:51:29 -08:00
8a3375bb23 v1.6.4 2014-02-05 01:03:05 -08:00
8bd54a7427 upgrade wakatime package to v1.0.0 for mercurial support 2014-02-05 01:01:47 -08:00
fcbbf05933 v1.6.3 2014-01-15 16:46:32 -08:00
9733087094 upgrade wakatime package to v0.5.3 2014-01-15 16:45:07 -08:00
da4e02199a v1.6.2 2014-01-14 05:14:25 -08:00
09a16dea1e upgrade wakatime package to v0.5.2 2014-01-14 05:11:00 -08:00
4c7adf0943 v1.6.1 2013-12-13 16:38:52 +01:00
216a8eaa0a upgrade common wakatime package to v0.5.1 2013-12-13 16:37:54 +01:00
15 changed files with 159 additions and 35 deletions

View File

@ -3,6 +3,39 @@ History
-------
1.6.5 (2014-03-05)
++++++++++++++++++
- upgrade external wakatime package to v1.0.1
- use new domain wakatime.com
1.6.4 (2014-02-05)
++++++++++++++++++
- upgrade external wakatime package to v1.0.0
- support for mercurial revision control
1.6.3 (2014-01-15)
++++++++++++++++++
- upgrade common wakatime package to v0.5.3
1.6.2 (2014-01-14)
++++++++++++++++++
- upgrade common wakatime package to v0.5.2
1.6.1 (2013-12-13)
++++++++++++++++++
- upgrade common wakatime package to v0.5.1
- second line in .wakatime-project now sets branch name
1.6.0 (2013-12-13)
++++++++++++++++++

View File

@ -8,7 +8,7 @@ Installation
Heads Up! For Sublime Text 2 on Windows & Linux, WakaTime depends on [Python](http://www.python.org/getit/) being installed to work correctly.
1. Get an api key from: https://wakati.me
1. Get an api key from: https://wakatime.com/#apikey
2. Using [Sublime Package Control](http://wbond.net/sublime_packages/package_control):
@ -18,16 +18,16 @@ Heads Up! For Sublime Text 2 on Windows & Linux, WakaTime depends on [Python](ht
c) Type `wakatime`, then press `enter` with the `WakaTime` plugin selected.
3. You will see a prompt at the bottom asking for your [api key](https://www.wakati.me/#apikey). Enter your api key, then press `enter`.
3. You will see a prompt at the bottom asking for your [api key](https://www.wakatime.com/#apikey). Enter your api key, then press `enter`.
4. Use Sublime and your time will automatically be tracked for you.
5. Visit https://wakati.me to see your logged time.
5. Visit https://wakatime.com to see your logged time.
6. Consider installing [BIND9](https://help.ubuntu.com/community/BIND9ServerHowto#Caching_Server_configuration) to cache your repeated DNS requests: `sudo apt-get install bind9`
Screen Shots
------------
![Project Overview](https://www.wakati.me/static/img/ScreenShots/Screen Shot 2013-10-26 at 5.04.01 PM.png)
![Project Overview](https://www.wakatime.com/static/img/ScreenShots/Screen Shot 2013-10-26 at 5.04.01 PM.png)

View File

@ -1,11 +1,11 @@
""" ==========================================================
File: WakaTime.py
Description: Automatic time tracking for Sublime Text 2 and 3.
Maintainer: WakaTi.me <support@wakatime.com>
Website: https://www.wakati.me/
Maintainer: WakaTime <support@wakatime.com>
Website: https://www.wakatime.com/
==========================================================="""
__version__ = '1.6.0'
__version__ = '1.6.5'
import sublime
import sublime_plugin

View File

@ -3,7 +3,7 @@
// This settings file will be overwritten when upgrading.
{
// Your api key from https://www.wakati.me/#apikey
// Your api key from https://www.wakatime.com/#apikey
// Set this in your User specific WakaTime.sublime-settings file.
"api_key": "",

View File

@ -12,3 +12,4 @@ Patches and Suggestions
-----------------------
- 3onyc <3onyc@x3tech.com>
- userid <xixico@ymail.com>

View File

@ -3,6 +3,36 @@ History
-------
1.0.1 (2014-03-05)
++++++++++++++++++
- use new domain name wakatime.com
1.0.0 (2014-02-05)
++++++++++++++++++
- detect project name and branch name from mercurial revision control
0.5.3 (2014-01-15)
++++++++++++++++++
- bug fix for unicode in Python3
0.5.2 (2014-01-14)
++++++++++++++++++
- minor bug fix for Subversion on non-English systems
0.5.1 (2013-12-13)
++++++++++++++++++
- second line in .wakatime-project file now sets branch name
0.5.0 (2013-12-13)
++++++++++++++++++

View File

@ -1,4 +1,4 @@
Copyright (c) 2013 Alan Hamlett https://wakati.me
Copyright (c) 2013 Alan Hamlett https://wakatime.com
All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -12,7 +12,7 @@ modification, are permitted provided that the following conditions are met:
in the documentation and/or other materials provided
with the distribution.
* Neither the names of Wakatime or Wakati.Me, nor the names of its
* Neither the names of Wakatime or WakaTime, nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

View File

@ -1,8 +1,9 @@
WakaTime
========
Automatic time tracking for your text editor. This is the common interface
for the WakaTime api. You shouldn't need to directly use this package.
Fully automatic time tracking for your text editor.
This is the common interface for the WakaTime api. You shouldn't need to directly use this package unless you are creating a new plugin.
Go to http://wakatime.com to install the plugin for your text editor.
@ -10,4 +11,4 @@ Go to http://wakatime.com to install the plugin for your text editor.
Installation
------------
https://www.wakati.me/help/plugins/installing-plugins
https://www.wakatime.com/help/plugins/installing-plugins

View File

@ -12,7 +12,7 @@ setup(
version=VERSION,
license='BSD 3 Clause',
description=' '.join([
'Action event appender for Wakati.Me, a time',
'Action event appender for WakaTime, a time',
'tracking api for text editors.',
]),
long_description=open('README.rst').read(),

View File

@ -3,9 +3,8 @@
wakatime
~~~~~~~~
Common interface to WakaTime.com for most text editor plugins.
WakaTime.com is fully automatic time tracking for text editors.
More info at http://wakatime.com
Common interface to the WakaTime api.
http://wakatime.com
:copyright: (c) 2013 Alan Hamlett.
:license: BSD, see LICENSE for more details.
@ -14,7 +13,7 @@
from __future__ import print_function
__title__ = 'wakatime'
__version__ = '0.5.0'
__version__ = '1.0.1'
__author__ = 'Alan Hamlett'
__license__ = 'BSD'
__copyright__ = 'Copyright 2013 Alan Hamlett'
@ -135,7 +134,7 @@ def parseArguments(argv):
# define supported command line arguments
parser = argparse.ArgumentParser(
description='Wakati.Me event api appender')
description='Common interface for the WakaTime api.')
parser.add_argument('--file', dest='targetFile', metavar='file',
action=FileAction, required=True,
help='absolute path to file for current action')
@ -150,7 +149,7 @@ def parseArguments(argv):
help='optional text editor plugin name and version '+
'for User-Agent header')
parser.add_argument('--key', dest='key',
help='your wakati.me api key; uses api_key from '+
help='your wakatime api key; uses api_key from '+
'~/.wakatime.conf by default')
parser.add_argument('--ignore', dest='ignore', action='append',
help='filename patterns to ignore; POSIX regex syntax; can be used more than once')
@ -228,7 +227,7 @@ def get_user_agent(plugin):
def send_action(project=None, branch=None, stats={}, key=None, targetFile=None,
timestamp=None, isWrite=None, plugin=None, **kwargs):
url = 'https://www.wakati.me/api/v1/actions'
url = 'https://www.wakatime.com/api/v1/actions'
log.debug('Sending action to api at %s' % url)
data = {
'time': timestamp,

View File

@ -13,15 +13,18 @@ import logging
import os
from .base import BaseProject
try:
from collections import OrderedDict
except ImportError:
from ..packages.ordereddict import OrderedDict
log = logging.getLogger(__name__)
# str is unicode in Python3
try:
unicode
except NameError:
unicode = str
class Git(BaseProject):
def process(self):

View File

@ -18,13 +18,41 @@ from .base import BaseProject
log = logging.getLogger(__name__)
# str is unicode in Python3
try:
unicode
except NameError:
unicode = str
class Mercurial(BaseProject):
def process(self):
return False
self.configDir = self._find_hg_config_dir(self.path)
return self.configDir is not None
def name(self):
if self.configDir:
return unicode(os.path.basename(os.path.dirname(self.configDir)))
return None
def branch(self):
return None
if self.configDir:
branch_file = os.path.join(self.configDir, 'branch')
try:
with open(branch_file) as fh:
return unicode(fh.readline().strip().rsplit('/', 1)[-1])
except IOError:
pass
return unicode('default')
def _find_hg_config_dir(self, path):
path = os.path.realpath(path)
if os.path.isfile(path):
path = os.path.split(path)[0]
if os.path.isdir(os.path.join(path, '.hg')):
return os.path.join(path, '.hg')
split_path = os.path.split(path)
if split_path[1] == '':
return None
return self._find_hg_config_dir(split_path[0])

View File

@ -29,6 +29,13 @@ from .base import BaseProject
log = logging.getLogger(__name__)
# str is unicode in Python3
try:
unicode
except NameError:
unicode = str
class ProjectMap(BaseProject):
def process(self):

View File

@ -24,6 +24,13 @@ except ImportError:
log = logging.getLogger(__name__)
# str is unicode in Python3
try:
unicode
except NameError:
unicode = str
class Subversion(BaseProject):
def process(self):
@ -41,6 +48,7 @@ class Subversion(BaseProject):
info = OrderedDict()
stdout = None
try:
os.environ['LANG'] = 'en_US'
stdout, stderr = Popen([
'svn', 'info', os.path.realpath(path)
], stdout=PIPE, stderr=PIPE).communicate()

View File

@ -4,7 +4,8 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~
Information from a .wakatime-project file about the project for
a given file.
a given file. First line of .wakatime-project sets the project
name. Second line sets the current branch name.
:copyright: (c) 2013 Alan Hamlett.
:license: BSD, see LICENSE for more details.
@ -19,24 +20,37 @@ from .base import BaseProject
log = logging.getLogger(__name__)
# str is unicode in Python3
try:
unicode
except NameError:
unicode = str
class WakaTime(BaseProject):
def process(self):
self.config = self._find_config(self.path)
self._project_name = None
self._project_branch = None
if self.config:
try:
with open(self.config) as fh:
self._project_name = unicode(fh.readline().strip())
self._project_branch = unicode(fh.readline().strip())
except IOError as e:
log.exception("Exception:")
return True
return False
def name(self):
try:
with open(self.config) as fh:
return unicode(fh.readline().strip())
except IOError as e:
log.exception("Exception:")
return None
return self._project_name
def branch(self):
return None
return self._project_branch
def _find_config(self, path):
path = os.path.realpath(path)