Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

Gonzotek, you get it! thanks for the support.
See Windows and Linux people can get along. before Linux or Windows, we were People.
Gonzotek you sound like that most rare type of person, an open source windows user.
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

ok kate apparently has support for brightscript. it may not be in the current version yet. although I just upgraded to 11.04 so it maybe included in the new version of kate. sweet. all I have to do now finish the scripts and make a bash script to run inside of kate(I love KDE)


http://permalink.gmane.org/gmane.comp.k ... rite/28073

Review request for Kate.
By Jakub Stachowski.
Description
Syntax highlighting file for BrightScript (VBScript based language used by Roku digital video player). SDK comes without any IDE or plugin for one, so highlighting in Kate makes it easier to develop. In addition to highlighting keywords, built-in functions, etc. code folding works too.
Testing
Loaded example source files from Roku SDK, verified that highlighting and folding works as expected.
Diffs
/trunk/KDE/kdelibs/kate/syntax/data/brightscript.xml (PRE-CREATION)
View Diff

_______________________________________________
KWrite-Devel mailing list
KWrite-Devel <at> kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

good news everyone I was able to with some editing grab a brightscript syntax highlighting xml file from that previous link. I will make an entire howto when I get kate scripts done.
But for now here is how to install the syntax highlighting.
I am on a debian system so I did a file search for bash.xml and copied brightscript.xml to those directories and restarted kate. And boom, I now get syntax highlighting of brightscript in kate! well over half of the battle is done.
This is what I did on my system, if you run a debian based system it might work.

sudo cp brightscript.xml /usr/share/apps/katepart/syntax
sudo cp brightscript.xml /usr/share/kde4/apps/katepart/syntax/

Here is the actual file. Just cut and paste it into an editor and save it as brightscript.xml

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language name="BrightScript" version="0.1" kateversion="3.5" section="Sources" extensions="*.brs;" author="Jakub Stachowski (qbast@go2.pl)" license="GPL">
<highlighting>
<list name="Keywords">
<item>Dim</item>
<item>End</item>
<item>Stop</item>
<item>Goto</item>
<item>Return</item>
<item>For</item>
<item>To</item>
<item>Step</item>
<item>For Each</item>
<item>In</item>
<item>While</item>
<item>Exit while</item>
<item>If</item>
<item>Then</item>
<item>Else</item>
<item>Elseif</item>
<item>Step</item>
<item>Print</item>
<item>As</item>
<item>Function</item>
<item>LINE_NUM</item>
</list>
<list name="Data Types">
<item> Integer </item>
<item> Boolean </item>
<item> Float </item>
<item> Double </item>
<item> String </item>
<item> Dynamic </item>
<item> Object </item>
<item> Interface </item>
<item> Void </item>
</list>
<list name="functions">
<item>Type</item>
<item>Rnd</item>
<item>Box</item>
<item>Run</item>
<item>Eval</item>
<item>GetLastRunCompileError</item>
<item>GetLastRunRuntimeError</item>
<item>Sleep</item>
<item>Wait</item>
<item>CreateObject</item>
<item>GetInterface</item>
<item>UpTime</item>
<item>RebootSystem</item>
<item>ListDir</item>
<item>ReadAsciiFile</item>
<item>WriteAsciiFile</item>
<item>CopyFile</item>
<item>MatchFiles</item>
<item>DeleteFile</item>
<item>DeleteDirectory</item>
<item>CreateDirectory</item>
<item>FormatDrive</item>
<item>UCase</item>
<item>LCase</item>
<item>Asc</item>
<item>Chr</item>
<item>Instr</item>
<item>Left</item>
<item>Len</item>
<item>Mid</item>
<item>Right</item>
<item>Str</item>
<item>Stri</item>
<item>Val</item>
<item>Abs</item>
<item>Atn</item>
<item>Cos</item>
<item>Csng</item>
<item>Cdbl</item>
<item>Exp</item>
<item>Fix</item>
<item>Log</item>
<item>Sgn</item>
<item>Sin</item>
<item>Sqr</item>
<item>Tan</item>
</list>

<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">

<RegExpr attribute="Keywords" context="#stay" String="\b(exit (for|while))([\s]|$)" insensitive="true" />
<RegExpr attribute="Keywords" context="#stay" String="\b(m\.)" insensitive="true" />

<RegExpr attribute="Keywords" context="#stay" String="\b(while)([\s\(]|$)" insensitive="true" beginRegion="WhileRegion"/>
<RegExpr attribute="Keywords" context="#stay" String="\b(end ?while)([\s]|$)" insensitive="true" endRegion="WhileRegion"/>

<RegExpr attribute="Keywords" context="#stay" String="\b(for)([\s]|$)" insensitive="true" beginRegion="ForRegion"/>
<RegExpr attribute="Keywords" context="#stay" String="\b((end ?for)|next)([\s]|$)" insensitive="true" endRegion="ForRegion"/>

<RegExpr attribute="Keywords" context="#stay" String="\b(function)([.\s]|$)" insensitive="true" beginRegion="fProcedureRegion"/>
<RegExpr attribute="Keywords" context="#stay" String="\b(end ?function)([\s]|$)" insensitive="true" endRegion="fProcedureRegion"/>

<RegExpr attribute="Keywords" context="#stay" String="\b(sub)([.\s]|$)" insensitive="true" beginRegion="sProcedureRegion"/>
<RegExpr attribute="Keywords" context="#stay" String="\b(end ?sub)([\s]|$)" insensitive="true" endRegion="sProcedureRegion"/>

<RegExpr attribute="Keywords" context="#stay" String="\b(if)([\s]|$)" insensitive="true" beginRegion="IfRegion"/>
<RegExpr attribute="Keywords" context="AfterThen" String="\b(then)" insensitive="true" />
<RegExpr attribute="Keywords" context="#stay" String="\b(else( ?if)?)([\s]|$)" insensitive="true" beginRegion="IfRegion" endRegion="IfRegion"/>
<RegExpr attribute="Keywords" context="#stay" String="\b(end ?if)([\s]|$)" insensitive="true" endRegion="IfRegion"/>

<keyword attribute="Keywords" context="#stay" String="Keywords"/>
<keyword attribute="Data Types" context="#stay" String="Data Types"/>

<keyword attribute="Functions" context="#stay" String="functions"/>

<Float attribute="Number" context="#stay"/>
<Int attribute="Number" context="#stay"/>

<DetectChar attribute="String" context="String" char="&quot;" />
<DetectChar attribute="Comment" context="Comment1" char="'"/>
<RegExpr attribute="Comment" context="Comment1" String="^[\s]*REM[\s]*" />
</context>

<context attribute="Normal Text" lineEndContext="#pop" name="AfterThen">
<RegExpr attribute="Keywords" context="#pop" String="([\s]+[a-zA-Z_]+)" lookAhead="true" endRegion="IfRegion"/>
</context>

<context attribute="String" lineEndContext="#pop" name="String">
<DetectChar attribute="String" context="#pop" char="&quot;"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="Comment1">
<keyword attribute="Number" context="#stay" String="attention" />
</context>
</contexts>

<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="Keywords" defStyleNum="dsKeyword"/>
<itemData name="Functions" defStyleNum="dsFunction"/>
<itemData name="Data Types" defStyleNum="dsDataType"/>
<itemData name="Number" defStyleNum="dsDecVal"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Region Marker " defStyleNum="dsRegionMarker"/>
</itemDatas>
</highlighting>
<general>
<keywords casesensitive="0" />
<comments>
<comment name="singleLine" start="'" />
<comment name="remark" start="REM " />
</comments>
</general>
</language>
<!-- // kate: space-indent on; indent-width 2; replace-tabs on; -->
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

just an afterthought, with KDE for windows you can use kate in windows. when I get a chance I will do a linux and then a windows howto for this.
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

Even as a Windows user, I'm on manoflinux's side on this one. While learning the language was my first goal, I quickly realized that I needed some level of automation. Maybe it's just my development style, but I am constantly side loading my code as I make changes to it, so manually zipping it and uploading the file via the web page is very tedious, at best. I now have a horribly over-complicated batch file that does everything for me using 7zip and curl. It even takes command line parameters so I can specify whether it should be packed for publishing (rekeys the box, zips, and uploads), include the core framework I've built, or just side load for testing (or any combination of the above). I've even come up with a way to specify whether to build the "lite" version or the full version without requiring two separate codebases. I have a command window open at all times, so packaging and uploading is as simple as pressing up to pull up the last command and hitting enter. And I now never build a publishable package with the wrong key by accident. Good stuff...

So, even though I'll never actually use this, I can appreciate what manoflinux is trying to accomplish, and thank him for sharing it with the community!
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

"TheEndless" wrote:
So, even though I'll never actually use this, I can appreciate what manoflinux is trying to accomplish, and thank him for sharing it with the community!

NP, like I said its partially out of my own self interest. I have some projects I want to do with the Roku and need this.
But it always nice to hear thanks. Your welcome.
0 Kudos
Highlighted
Level 10

Re: bash scripts to upload and delete from the roku menu

Once you start working on what I'd call 'infrastructure" like automation, porting standard functionality to other languages and platforms, um, how do you say, 'efficiency expert modification' of your code, and figuring out the absolute quickest ways to accomplish your goals, I think you get further away from the original purpose of the device itself. You can spend years and years refining your scripts and tinkering with the bits to get it just right, and if that's what you enjoy doing, that is just plain awesome. Have fun. There is nothing wrong with that, just on a side note, if you have to repackage a channel 30 times per day, the same channel, and experiment by changing a line, zipping, and uploading, are you really leaning anything?
0 Kudos
Highlighted
Level 10

Re: bash scripts to upload and delete from the roku menu

or perhaps you mean you rezip and repackage stuff to see what it looks like when you change the graphic locations by a single pixel at a time for placement of logos or something - for that, you can save time by opening up a graphics program with the screen dimensions (1280 x 720) and place your graphics on that and note the pixel locations, and the roku SDK screens template shows you where the visible area is too with guidelines.
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

"destruk" wrote:
just on a side note, if you have to repackage a channel 30 times per day, the same channel, and experiment by changing a line, zipping, and uploading, you're not learning anything

If you're developing simple apps that just parse an RSS feed or some other formatted content and display it through the built-in screens, that's probably true, but if you're developing apps that actually push the limits of the SDK (i.e. games, custom UIs, complex hierarchical navigation, etc.), it's impossible to develop effectively without, at the very least, regular unit testing. Most platforms provide some method of testing your code in your development environment, either through a remote compiler or an emulator, to make those tasks easier. With the Roku, uploading to the device is the only option.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
Highlighted
Level 8

Re: bash scripts to upload and delete from the roku menu

I was going to say something but endless took care of you.
0 Kudos