Skip to content
Browse files

Restructure modules to have core and contributed modules.

The restructuring should make it easy for us to pull the core modules
into the Sequel Pro trunk.

Pulling bundles into http://www.sequelpro.com/bundles/ should also be a
little easier with this new structure.
  • Loading branch information...
1 parent 8691dc4 commit ae34e59961257d7119ee84a700cafbb35d653bb9 @mattlangtree mattlangtree committed Sep 4, 2012
View
BIN .DS_Store
Binary file not shown.
View
BIN contributed/.DS_Store
Binary file not shown.
View
105 contributed/Copy as CSV.spBundle/command.plist
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>author</key>
+ <string>Liviu Tudor</string>
+ <key>category</key>
+ <string>Copy</string>
+ <key>command</key>
+ <string>cat | perl -e '
+
+# read first line to get the column names (header)
+$firstLine = &lt;&gt;;
+
+# bail if nothing could read
+if(!defined($firstLine)) {
+ exit 0;
+}
+
+# store the column names
+chomp($firstLine);
+$firstLine =~ s/\"/\\\"/g; # escape "
+@header = split(/\t/, $firstLine);
+
+$h_cnt = $#header; # number of columns
+
+# get the column definitions
+open(META, $ENV{"SP_BUNDLE_INPUT_TABLE_METADATA"}) or die $!;
+@meta = ();
+while(&lt;META&gt;) {
+ chomp();
+ my @arr = split(/\t/);
+ push @meta, \@arr;
+}
+close(META);
+
+for($i=0; $i&lt;=$h_cnt; $i++) {
+ print "\"$header[$i]\"";
+ if( $i&lt;$h_cnt) {
+ print ";";
+ } else {
+ print "\n";
+ }
+}
+
+# read row data of each selected row
+$rowData=&lt;&gt;;
+while($rowData) {
+
+ # remove line ending
+ chomp($rowData);
+
+ # escape "
+ $rowData=~s/\"/\\\"/g;
+
+ # split column data which are tab-delimited
+ @data = split(/\t/, $rowData);
+ for($i=0; $i&lt;=$h_cnt; $i++) {
+ # re-escape \t and \n
+ $cellData = $data[$i];
+ $cellData =~ s/↵/\n/g;
+ $cellData =~ s/⇥/\t/g;
+
+ # check for data types
+ if($cellData eq "NULL") {
+ print "NULL";
+ } else {
+ chomp($cellData);
+ print "\"$cellData\"";
+ }
+ if($i&lt;$h_cnt) {
+ print ";";
+ } else {
+ print "\n";
+ }
+ }
+
+ # get next row
+ $rowData=&lt;&gt;;
+}
+
+print "\n";
+' | __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy</string>
+ <key>contact</key>
+ <string>yvivh.ghqbe@tznvy.pbz</string>
+ <key>description</key>
+ <string>Copies the selected rows to clipboard as CSV separating data by semi-colon</string>
+ <key>input</key>
+ <string>selectedtablerowsastab</string>
+ <key>keyEquivalent</key>
+ <string></string>
+ <key>name</key>
+ <string>Copy as CSV</string>
+ <key>output</key>
+ <string>none</string>
+ <key>scope</key>
+ <string>datatable</string>
+ <key>tooltip</key>
+ <string>Copy as CSV</string>
+ <key>trigger</key>
+ <string>none</string>
+ <key>uuid</key>
+ <string>E24C4537-0AAB-4C17-B5F9-C5054CADA77C</string>
+</dict>
+</plist>
View
104 contributed/CopyAsHTML.spBundle/command.plist
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>author</key>
+ <string>Liviu Tudor</string>
+ <key>category</key>
+ <string>Copy</string>
+ <key>command</key>
+ <string>cat | perl -e '
+
+# read first line to get the column names (header)
+$firstLine = &lt;&gt;;
+
+# bail if nothing could read
+if(!defined($firstLine)) {
+ exit 0;
+}
+
+# store the column names
+chomp($firstLine);
+$firstLine =~ s/\"/\\\"/g; # escape "
+@header = split(/\t/, $firstLine);
+
+$h_cnt = $#header; # number of columns
+
+# get the column definitions
+open(META, $ENV{"SP_BUNDLE_INPUT_TABLE_METADATA"}) or die $!;
+@meta = ();
+while(&lt;META&gt;) {
+ chomp();
+ my @arr = split(/\t/);
+ push @meta, \@arr;
+}
+close(META);
+
+print "&lt;table border=\"1\" cellpadding=\"0\" cellspacing=\"0\"&gt;\n";
+print "&lt;tr&gt;";
+for($i=0; $i&lt;=$h_cnt; $i++) {
+ print "&lt;th&gt;$header[$i]&lt;/th&gt;";
+}
+print "&lt;/tr&gt;\n";
+
+# read row data of each selected row
+$rowData=&lt;&gt;;
+while($rowData) {
+
+ print "&lt;tr&gt;";
+
+ # remove line ending
+ chomp($rowData);
+
+ # escape "
+ $rowData=~s/\"/\\\"/g;
+
+ # split column data which are tab-delimited
+ @data = split(/\t/, $rowData);
+ for($i=0; $i&lt;=$h_cnt; $i++) {
+ # re-escape \t and \n
+ $cellData = $data[$i];
+ $cellData =~ s/↵/\n/g;
+ $cellData =~ s/⇥/\t/g;
+
+ print "&lt;td&gt;";
+ # check for data types
+ if($cellData eq "NULL") {
+ print "NULL";
+ } else {
+ chomp($cellData);
+ print "$cellData";
+ }
+ print "&lt;/td&gt;";
+ }
+
+ print "&lt;/tr&gt;\n";
+
+ # get next row
+ $rowData=&lt;&gt;;
+}
+
+print "&lt;/table&gt;\n";
+' | __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy</string>
+ <key>contact</key>
+ <string>yvivh.ghqbe@tznvy.pbz</string>
+ <key>description</key>
+ <string>Copies the selected rows to clipboard as html</string>
+ <key>input</key>
+ <string>selectedtablerowsastab</string>
+ <key>keyEquivalent</key>
+ <string></string>
+ <key>name</key>
+ <string>Copy as HTML</string>
+ <key>output</key>
+ <string>none</string>
+ <key>scope</key>
+ <string>datatable</string>
+ <key>tooltip</key>
+ <string>Copy as HTML</string>
+ <key>trigger</key>
+ <string>none</string>
+ <key>uuid</key>
+ <string>31FD6D95-CED5-4870-9A19-5A1396216C37</string>
+</dict>
+</plist>
View
111 contributed/CopyAsWiki.spBundle/command.plist
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>author</key>
+ <string>Liviu Tudor</string>
+ <key>category</key>
+ <string>Copy</string>
+ <key>command</key>
+ <string>cat | perl -e '
+
+# read first line to get the column names (header)
+$firstLine = &lt;&gt;;
+
+# bail if nothing could read
+if(!defined($firstLine)) {
+ exit 0;
+}
+
+# store the column names
+chomp($firstLine);
+$firstLine =~ s/\"/\\\"/g; # escape "
+@header = split(/\t/, $firstLine);
+
+$h_cnt = $#header; # number of columns
+
+# get the column definitions
+open(META, $ENV{"SP_BUNDLE_INPUT_TABLE_METADATA"}) or die $!;
+@meta = ();
+while(&lt;META&gt;) {
+ chomp();
+ my @arr = split(/\t/);
+ push @meta, \@arr;
+}
+close(META);
+
+print "||";
+for($i=0; $i&lt;=$h_cnt; $i++) {
+ print " *$header[$i]* ||";
+}
+print "\n";
+
+# read row data of each selected row
+$rowData=&lt;&gt;;
+while($rowData) {
+
+ print "||";
+
+ # remove line ending
+ chomp($rowData);
+
+ # escape "
+ $rowData=~s/\"/\\\"/g;
+
+ # split column data which are tab-delimited
+ @data = split(/\t/, $rowData);
+ for($i=0; $i&lt;=$h_cnt; $i++) {
+ # re-escape \t and \n
+ $cellData = $data[$i];
+ $cellData =~ s/↵/\n/g;
+ $cellData =~ s/⇥/\t/g;
+
+ # check for data types
+ if($cellData eq "NULL") {
+ print " _NULL_ ";
+ } else {
+ chomp($cellData);
+ print " *$cellData* ";
+ }
+ print "||";
+ }
+
+ print "\n";
+
+ # get next row
+ $rowData=&lt;&gt;;
+}
+
+print "\n";
+' | __CF_USER_TEXT_ENCODING=$UID:0x8000100:0x8000100 pbcopy</string>
+ <key>contact</key>
+ <string>yvivh.ghqbe@tznvy.pbz</string>
+ <key>description</key>
+ <string>Copies the selected rows to clipboard as wiki table</string>
+ <key>input</key>
+ <string>selectedtablerowsastab</string>
+ <key>internalKeyEquivalent</key>
+ <dict>
+ <key>characters</key>
+ <string>C</string>
+ <key>keyCode</key>
+ <integer>8</integer>
+ <key>modifierFlags</key>
+ <integer>262144</integer>
+ </dict>
+ <key>keyEquivalent</key>
+ <string>^c</string>
+ <key>name</key>
+ <string>Copy as Wiki</string>
+ <key>output</key>
+ <string>none</string>
+ <key>scope</key>
+ <string>datatable</string>
+ <key>tooltip</key>
+ <string>Copy as Wiki</string>
+ <key>trigger</key>
+ <string>none</string>
+ <key>uuid</key>
+ <string>5B20D1B9-9C60-4D9F-B51B-5F742665557E</string>
+</dict>
+</plist>
View
0 Deserialize php.spBundle/command.plist → ...ed/Deserialize php.spBundle/command.plist 100644 → 100755
File renamed without changes.
View
BIN core/.DS_Store
Binary file not shown.
View
0 CopyAsJSON.spBundle/command.plist → core/CopyAsJSON.spBundle/command.plist
File renamed without changes.
View
0 CopySingleLineQuoted.spBundle/command.plist → ...pySingleLineQuoted.spBundle/command.plist
File renamed without changes.
View
0 DB Report.spBundle/Support/header.html → core/DB Report.spBundle/Support/header.html
File renamed without changes.
View
0 ...port.spBundle/Support/processTableData.pl → ...port.spBundle/Support/processTableData.pl
File renamed without changes.
View
0 DB Report.spBundle/command.plist → core/DB Report.spBundle/command.plist
File renamed without changes.
View
0 Format SQL.spBundle/command.plist → core/Format SQL.spBundle/command.plist
File renamed without changes.
View
0 MD5 Hash.spBundle/command.plist → core/MD5 Hash.spBundle/command.plist
File renamed without changes.
View
0 Open Selected Table.spBundle/command.plist → ...pen Selected Table.spBundle/command.plist
File renamed without changes.
View
0 SHA1 Hash.spBundle/command.plist → core/SHA1 Hash.spBundle/command.plist
File renamed without changes.
View
0 SHA1 Hash.spBundle/echo-n → core/SHA1 Hash.spBundle/echo-n
File renamed without changes.
View
0 Toggle JSON Format.spBundle/command.plist → ...Toggle JSON Format.spBundle/command.plist
File renamed without changes.
View
0 WrapInDelimiter.spBundle/command.plist → core/WrapInDelimiter.spBundle/command.plist
File renamed without changes.

0 comments on commit ae34e59

Please sign in to comment.
Something went wrong with that request. Please try again.