Permalink
Browse files

Readme added. Can now configure the adb command used.

  • Loading branch information...
1 parent 077c5ac commit 0efa259bffb720085bba92d3a339b392cb091138 @quarnster committed Jan 31, 2012
Showing with 79 additions and 5 deletions.
  1. +1 −1 Default.sublime-keymap
  2. +48 −0 README.creole
  3. +30 −4 adbview.py
View
@@ -2,6 +2,6 @@
{
"command": "adb_launch",
- "keys": ["ctrl+d"]
+ "keys": ["ctrl+alt+d"]
}
]
View
@@ -0,0 +1,48 @@
+=== Description ===
+A plugin that provides an ADB Logcat view inside of Sublime Text 2.
+
+=== Known issues and feature requests ===
+Please go [[https://github.com/quarnster/ADBView/issues?sort=created&direction=desc&state=open|here]] to see the currently known issues and feature request, or to file a new.
+
+=== Prerequisites ===
+ # The Android SDK should be installed, and ADB should be in your path.
+
+=== Installation ===
+ # The easiest way to install this plugin is via the excellent Package Control Plugin
+ ## See http://wbond.net/sublime_packages/package_control#Installation
+ ### Once package control has been installed, bring up the command palette (cmd+shift+P or ctrl+shift+P)
+ ### Type Install and select "Package Control: Install Package"
+ ### Select ADBView from the list. Package Control will keep it automatically updated for you
+ ## If you don't want to use package control, you can manually install it
+ ### Go to your packages directory and type:
+ #### git clone https://github.com/quarnster/ADBView ADBView
+ # The default command is ["adb", logcat"]. If you want to change this you can do so via the file setting "adb_command"
+
+=== Usage ===
+After installation, hit ctrl+alt+d to open up an ADB logcat view.
+
+=== License ===
+This plugin is using the zlib license
+
+{{{
+Copyright (c) 2012 Fredrik Ehnbom
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
+}}}
View
@@ -1,4 +1,27 @@
-import sublime, sublime_plugin
+"""
+Copyright (c) 2012 Fredrik Ehnbom
+
+This software is provided 'as-is', without any express or implied
+warranty. In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
+"""
+import sublime
+import sublime_plugin
import subprocess
import Queue
import threading
@@ -109,6 +132,7 @@ def update(self):
adb_view = ADBView()
adb_process = None
+
def output(pipe):
while True:
try:
@@ -124,10 +148,13 @@ def output(pipe):
class AdbLaunch(sublime_plugin.WindowCommand):
def run(self):
- print "launch"
global adb_process
if adb_process == None or adb_process.poll() != None:
- adb_process = subprocess.Popen(["adb", "logcat"], shell=False, stdout=subprocess.PIPE)
+ cmd = ["adb", "logcat"]
+ v = self.window.active_view()
+ if not v is None:
+ cmd = v.settings().get("adb_command", ["adb", "logcat"])
+ adb_process = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE)
adb_view.open()
t = threading.Thread(target=output, args=(adb_process.stdout,))
t.start()
@@ -141,4 +168,3 @@ def on_close(self, view):
if adb_view.is_open() and view.id() == adb_view.get_view().id():
adb_view.was_closed()
adb_process.kill()
-

0 comments on commit 0efa259

Please sign in to comment.