Modifying Python Code in easy-ui-4

Moderators: Gully, peteru

Post Reply
Cheers
Apprentice
Posts: 16
Joined: Sat May 27, 2017 12:47

Modifying Python Code in easy-ui-4

Post by Cheers » Sun Jan 14, 2018 17:39

I'd like to make some small changes to some of the GUI Python code. E.g. changing MovieList.py so that it doesn't show any extra directories/files that start with a dot (.).

Although I understand the basics of how to do this, I realise that such changes may potentially have to be redone, every-time that there's a firmware upgrade, and I'd like to minimise the amount of work involved.

As part of this, I'm trying to understand how the source code on the Atlassian repository (https://bitbucket.org/beyonwiz/easy-ui-4/src) relates to individual releases, such as beyonwiz-17.5 20171230. In other words, if I want to get a copy of the source code that went into that particular release (rather than what's in the master branch right now), how do I do it? Please note that I have some knowledge of Git, but haven't used it a great deal.

Or is this not possible?

IanSav
Uber Wizard
Posts: 16846
Joined: Tue May 29, 2007 15:00
Location: Melbourne, Australia

Re: Modifying Python Code in easy-ui-4

Post by IanSav » Sun Jan 14, 2018 17:43

Hi Cheers,

Are you looking for a personal patch or to develop something that can go into the firmware for everyone?

Regards,
Ian.

prl
Wizard God
Posts: 32703
Joined: Tue Sep 04, 2007 13:49
Location: Canberra; Black Mountain Tower transmitters

Re: Modifying Python Code in easy-ui-4

Post by prl » Sun Jan 14, 2018 18:38

Cheers wrote:
Sun Jan 14, 2018 17:39
I'd like to make some small changes to some of the GUI Python code. E.g. changing MovieList.py so that it doesn't show any extra directories/files that start with a dot (.).

That's probably a good idea, but you may want to think whether there are any cases where they should be displayed. If you did it, you'd probably want to get rid of the more specific code that hides some system-generated OS X filenames that start with "._". In fact you can implement your idea simply by changing that test and moving it about 15 lines earlier in the code :)

The change is needed in MovieList.load() in lib/python/Components/MovieList.py.
Cheers wrote:
Sun Jan 14, 2018 17:39
... As part of this, I'm trying to understand how the source code on the Atlassian repository (https://bitbucket.org/beyonwiz/easy-ui-4/src) relates to individual releases, such as beyonwiz-17.5 20171230. In other words, if I want to get a copy of the source code that went into that particular release (rather than what's in the master branch right now), how do I do it? Please note that I have some knowledge of Git, but haven't used it a great deal.

Or is this not possible?

To answer the last question first, because the repository isn't tagged by release numbers, while it's possible in principle to get a checkout of the commit that corresponds to a particular release, it's not easy. I've asked in the past about getting the repository tagged by release, mainly so that if I'm trying to track down a user problem, I can look at the code that they're actually running, but my wish hasn't been granted.

As far as I know, everyone who's working on firmware development on the Beyonwiz simply creates a branch in their private repository clone from the current head of the main repository and works from there. The firmware generally isn't changing so fast that that's a problem.

I work on a private repository clone (since I don't have write access to the main repository).

Then the scheme is:
Discuss the bug or improvement on the forum.

Create an issue in the issue tracker that covers the bug or proposed improvement https://bitbucket.org/beyonwiz/easy-ui- ... tatus=open (the issue tracker is open for writes by any Bitbucket users).

Some time may pass...

Create a branch in my repository clone with a name that references the issue tracker, e.g. Fix-bug-NNN.

Modify and test the code and commit it to the branch. Possibly in a number of commits if the the change is biggish and can be broken into logical stages (e.g.the changes that I'm working on for the IMDb Search screen are broken into 8 commits).

When I'm satisfied with the code changes, switch to the master branch in my repository and pull any changes from the main repository into my clone's master branch.

The switch back to my working branch, do a git rebase on the master to merge any changes in the repository into my branch, and resolve any conflicts that that causes.

Then push the branch into the remote (Bitbucket) side of my clone.

Once that's done issue a pull request so that peteru can examine the changes and if they're acceptable, merge them into the main repository.

Some time later, the changes emerge in a beta release.

Using Bitbucket and git can be a bit of a steep learning curve if you haven't used them before.
Peter
T4 HDMI
U4, T4, T3, T2, V2 test/development machines
Sony BDV-9200W HT system
LG OLED55C9PTA 55" OLED TV

User avatar
peteru
Uber Wizard
Posts: 9735
Joined: Tue Jun 12, 2007 23:06
Location: Sydney, Australia
Contact:

Re: Modifying Python Code in easy-ui-4

Post by peteru » Sun Jan 14, 2018 21:24

Cheers wrote:
Sun Jan 14, 2018 17:39
if I want to get a copy of the source code that went into that particular release (rather than what's in the master branch right now), how do I do it?

There are two ways:

1. Install the corresponding source package for enigma2.

Code: Select all

# opkg update
# opkg upgrade
# opkg install enigma2-src
This should install the corresponding source files on the Beyonwiz itself. The update and upgrade steps are there to ensure that you are in sync with the feeds. This will give you the current version, if you want an older version, you need to use the following method.


2. Check out the git revision that matches the package name.

Code: Select all

# opkg list-installed enigma2
enigma2 - 17.5+git39460+3f0ab2c-r0.0
Then on your workstation, use 3f0ab2c as the hash when specifying the git revision to check out / branch from.

Either method will give you exactly the same source code that was used by the build system to generate the installed packages.

"Beauty lies in the hands of the beer holder."
Blog.

Post Reply

Return to “Developers Community”