Skip to content

Commit

Permalink
Finish Hotfix-0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
FichteFoll committed Jan 12, 2014
2 parents 0068bfa + fc92bb4 commit 135af12
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,13 @@
InsertDate Changelog
====================

v0.5.2 (2014-01-12)
-------------------

- Fixed the package not working at all on both ST2 and ST3 (#7)
- Added instructions for usage in macros/snippets


v0.5.1 (2014-01-11)
-------------------

Expand Down
30 changes: 30 additions & 0 deletions README.md
Expand Up @@ -26,6 +26,13 @@ Alternatively you can download a recent [zip archive][releases] and extract it i
Usage
-----

### Screenshot ###

The panel opens on <kbd>F5</kbd> and shows a selection of pre-defined settings that can be modified. See [Settings][#settings] on how to do that.

[![][scr-panel-thumb]][scr-panel]


### Command Examples ###

The following is an excerpt of the [default key bindings][keymap] (on [OSX][keymap-osx]: `super` instead of `ctrl`):
Expand Down Expand Up @@ -107,6 +114,23 @@ For more information about the accepted formatting syntax, see <http://strfti.me
- `%p` also corresponds to the locale's setting, thus using `%p` e.g. on a German system gives an empty string.


### Snippets Macros ###

You can use the `insert_date` command in combination with snippets and macros. Here is an example:

```json
[
{ "command": "insert_snippet", "args": {"contents": "Date: $1\nTime: $2\nSomething else: $0"} },
{ "command": "insert_date", "args": {"format": "%x"} },
{ "command": "next_field" },
{ "command": "insert_date", "args": {"format": "%X"} },
{ "command": "next_field" }
]
```

Check the documentation for [Macros][doc-macros] and [Commands][doc-commands] for further information.


### Command Reference ###

***insert_date_panel***
Expand Down Expand Up @@ -237,8 +261,14 @@ ToDo
[strftime]: http://docs.python.org/3/library/datetime.html#strftime-strptime-behavior "Python docs: 8.1.8. strftime() and strptime() Behavior"
[pytz-down]: http://pypi.python.org/pypi/pytz#downloads "pytz : Python Package Index"

[scr-panel]: http://i.imgur.com/57S5iH2.png
[scr-panel-thumb]: http://i.imgur.com/57S5iH2l.png

[keymap]: Default.sublime-keymap "Default.sublime-keymap"
[keymap-osx]: Default%20%28OSX%29.sublime-keymap "Default (OSX).sublime-keymap"
[settings]: insert_date.sublime-settings "insert_date.sublime-settings"

[doc-macros]: http://docs.sublimetext.info/en/latest/extensibility/macros.html
[doc-commands]: http://docs.sublimetext.info/en/latest/reference/commands.html

[timezones]: https://github.com/FichteFoll/sublimetext-insertdate/blob/c879a70e12fb38c86a893b2be7979b4f7111b342/pytz/__init__.py#L527-L1101 "List of timezones in source"
2 changes: 1 addition & 1 deletion format_date.py
Expand Up @@ -17,7 +17,7 @@
import sys
ST2 = sys.version_info[0] == 2

if ST2:
if not ST2:
basestring = str


Expand Down
8 changes: 7 additions & 1 deletion insert_date.py
Expand Up @@ -16,15 +16,21 @@
fdate = FormatDate()
# Global settings object
s = None
# Print tracebacks
DEBUG = False


def status(msg, e=None):
msg = "[InsertDate] "
msg = "[InsertDate] " + msg
sublime.status_message(msg)
if e is not None:
msg += "\n%s: %s" % (type(e).__name__, e)
print(msg)

if e and DEBUG:
import traceback
traceback.print_exc()


# I wrote this for InactivePanes, but why not just use it here as well?
class Settings(object):
Expand Down
2 changes: 1 addition & 1 deletion messages.json
@@ -1,4 +1,4 @@
{
"install": "messages/install.md",
"0.5.1": "CHANGELOG.md"
"0.5.2": "CHANGELOG.md"
}

0 comments on commit 135af12

Please sign in to comment.