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.

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 kde.org
https://mail.kde.org/mailman/listinfo/kwrite-devel

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=""" />
        <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="""/>
      </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; -->

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.

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!

“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.

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?

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.

“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.

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

i have something to say since i have put together a few apps, and this is my last post in this kids never ending post.

the process that i use never takes over a couple seconds and i dont rezip etc and curl etc…

1.) I have one folder with the exact match of the zip file i then have the zip file open too. when i make a change, i drag from the source to the zip. time: 1 second

2.) My files are on desktop while working, i have the browser open to the installer. i click browse to get file time: 1 second

3.) Then upload file to roku Time: 1-2 seconds

Sorry if you think this is too time consuming, but for me that little break gives me a second to relax and get a drink or just wait. just take my eyes of the pc for a few seconds helps

I honestly think taking 3-5 seconds couldn’t add up to amount to what maybe 5 minutes of downtime in a 8-10 hour day at 100 uploads. I am sure more than that time is wasted by going to get coffee, go to the bathroom etc though out the day.

I totally agree it would take too much time when doing graphics and thats why i do it paint.net using the grid to see any changes, we have some stuff we been doing some custom video players and that is how we did it, but again we dont do all the drawing in the roku itself. we place it once and then move it in the paint program and then make changed to the code once we have it where we like it, now this type of work is very time consuming and would be nice if there was a easier way.

there ya go kid, now you can brag how this post got 1000 views !! it just might… especially if you post one after another to keep it at the top, try using the edit if you have a thought so quickly after the last post and your the last poster…

its not the time, its having to change your thought process away from coding that is what slows you down.
And I am glad you have finally agreed to be quiet.

“manoflinux” wrote:
And I am glad you have finally agreed to be quiet.
these forums have been very friendly till you came around, i think i speak for many that wish they go back to that way. You can’t hurl insults from behind your PC at everyone that does not agree with you.

“dynamitemedia” wrote:

“manoflinux” wrote:
And I am glad you have finally agreed to be quiet.
these forums have been very friendly till you came around, i think i speak for many that wish they go back to that way. You can’t hurl insults from behind your PC at everyone that does not agree with you.
I dont really see that being an insult. its kinda obvious we dont agree.
But I find it funny that someone is acting like doing stuff in notepad makes you better.
Its an awful tool. I dont make scripts by putting pictures together.
I write code in a simple but powerful text editor called kate.
Yes you can use a toothbrush to mop the floor and you may achieve the same results as using a mop.
But is it worth it in time and energy?
If want to use windows fine, but don’t tell me you are a better coder than me because you use notepad,
Its not like when someone talks about VI being better, VI is actually a very powerful editor.
Use syn editor http://sourceforge.net/projects/syn/ its free and does just about everything a programmer needs.
In fact from what I hear, no one seems to be aware of anything you have actually done.
I put my code out for everyone to see. let me see you do the same.

“dynamitemedia” wrote:
You can’t hurl insults from behind your PC at everyone that does not agree with you.
I’d encourage you to take your own advice. You don’t find this particular utility useful to you. That’s fine. Move on, but coming back in here and calling the OP “kid” continuously, because you don’t understand the point, and then complaining about insults being hurled is a bit like the pot calling the kettle black. It’s a two way street.

Back on topic, I’m of the general opinion that anything that has to be done more than a handful of times is worth automating. I’m also a developer who doesn’t like being distracted from his coding by the tools he’s using, so automated sideloading, syntax highlighting, and easy code navigation make me 1000% more efficient. The more efficient I am, the more productive I am, and the happier my clients are (especially those paying by the hour).

Hey, let’s simmer down, all. People should be free to choose the tools that work for them and to talk about those tools without concern that they’ll be belittled or attacked for exercising that option. If you’re not interested in the topic, or the person or people posting in the topic, just ignore it and/or them.

Back on topic, (sorta), I’ve gone ahead and started the syntax files for Crimson Editor, here’s an example(I’ll post a new topic when I’m ready to release them):

[upload|yHlwRatwzCB0hvvMWENmgw==]

Sorry to interject here, since I’m not a programmer, but the jibes and arguments end now. This is the Developer Program forum. People ask for help or give advice. You don’t have to listen to it, you don’t have to follow it, and you don’t have to agree with it. You don’t have to give it either.

Let’s behave guys :slightly_smiling_face: Let’s be friends.

C. Shawn Smith

all I am trying to do is create a easy way to create apps for your box(the roku) in linux and windows using the same opensource toolset. thats all.
I keep getting attacked by people over and over again.
ok next time it happens instead of responding back I will get you involved.

“gonzotek” wrote:
Hey, let’s simmer down, all. People should be free to choose the tools that work for them and to talk about those tools without concern that they’ll be belittled or attacked for exercising that option. If you’re not interested in the topic, or the person or people posting in the topic, just ignore it and/or them.

Back on topic, (sorta), I’ve gone ahead and started the syntax files for Crimson Editor, here’s an example(I’ll post a new topic when I’m ready to release them):

[upload|yHlwRatwzCB0hvvMWENmgw==]
Awesome!! The more tools to develop for the roku in the better.

Post removed to avoid further misinterpretation. My apologies.