Jump to content


Photo

merge requests for PLi's git


  • Please log in to reply
1748 replies to this topic

Re: merge requests for PLi's git #721 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 22 February 2015 - 19:19

Pushed... Thanks!!!

 

 

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #722 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 22 February 2015 - 21:04

Pushed...

 

Thank you!



Re: merge requests for PLi's git #723 ims

  • PLi® Core member
  • 13,624 posts

+212
Excellent

Posted 22 February 2015 - 21:38

2. I do not know what satellites.xml is in openpli feed, but I use it fromt the site http://satellites-xml.eu/ and there sat name is such as "Astra 4A / SES 5 (4.9E)", of course, that it is not properly displayed. The second patch fixed name, if in the sat name is "(".

your patch is not compatible with it... sorry, we must make it for our infos...

 

Here is patch for solving your patch for PLi, but I think, Littlesat must tell, if apply it or revert your http://sourceforge.n...8fc3b76eab734c/

 

Do you using original PLi ?

Attached Files


Kdo nic nedělá, nic nezkazí!

Re: merge requests for PLi's git #724 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 22 February 2015 - 22:05

pushed....

 

 
txt.gif  0001-fixed-orbital-position.patch   1.03KB   1 downloads

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #725 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 22 February 2015 - 23:00

Sorry that I have broken this.
As far as I understand orbital_position parses in db.cpp from file satellites.xml.
I asked o show me how sat name is specified in satellites.xml from openpli feed.
I see that there is "4.8E SES 5..Astra 4A" and your division according by " " is correct.
I see that in satellites.xml from satellites-xml.eu name is "Astra 4A / SES 5 (4.9E)", and here, this division is not correct.
Therefore, also introduced the "(" test, and I do not understand why it is not working. Obviously orbital_position returns a string where also is "(", and my division by "(" is not correct.  :(
I do not like the slowness find here, I will find exactly what orbital_position returns on the original image and try to offer own version.



Re: merge requests for PLi's git #726 ims

  • PLi® Core member
  • 13,624 posts

+212
Excellent

Posted 22 February 2015 - 23:05

but in last patche is still your version...and for pli too


Kdo nic nedělá, nic nezkazí!

Re: merge requests for PLi's git #727 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 22 February 2015 - 23:18

I saw my error.
I forgot split(" '')[0] for the standard version.
I think that such variant would be much better. Check, it should now work properly.
Again apologized for my negligence.

Attached Files



Re: merge requests for PLi's git #728 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 23 February 2015 - 00:08

Pushed....

 

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #729 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 23 February 2015 - 20:30

Pushed....

 

Thank you!

 

Continuing to develop ServiceName:
1. If we use for example livestreamer, the first address in string will be 127.0.0.1, and of course it would not be correct IPTV server address. Therefore, we need to use rsplit instead of split.
2. What I have broken before.  ;)

Now we use orbital position which through ConvertToHumanReadable convert to satellite name, and from which we try to get the position.

Why? Why not use a direct orbital position?

The second patch is used a direct satellite position, which should avoid any satellites names conflicts in satellites.xml.

Attached Files


Edited by Taapat, 23 February 2015 - 20:32.


Re: merge requests for PLi's git #730 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 24 February 2015 - 22:25

Please ignore my 2 patch. From orbital position we can get only degrees and therefore should be used satellite name.



Re: merge requests for PLi's git #731 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 25 February 2015 - 11:54

Is the first patch fine???


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #732 Taapat

  • PLi® Core member
  • 2,343 posts

+120
Excellent

Posted 25 February 2015 - 15:01

Yes, first patch fine.



Re: merge requests for PLi's git #733 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 25 February 2015 - 15:10

Pushed....

 

 0001-ServiceName-use-rsplit-for-stream-services.patch   


WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #734 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 26 February 2015 - 23:43

diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py
index 680e95d..99a9465 100644
--- a/lib/python/Components/Input.py
+++ b/lib/python/Components/Input.py
@@ -62,11 +62,11 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                        self.currPos = 0
                        self.Text = u""
                else:
-                       self.Text = text.decode("utf-8", "ignore").decode("utf-8")
+                       self.Text = text.decode("utf-8", "ignore")
                self.update()

        def getText(self):
-               return self.Text.encode("utf-8")
+               return self.Text

        def createWidget(self, parent):
                if self.allmarked:
@@ -152,7 +152,8 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                self.update()

        def insertChar(self, ch, pos=False, owr=False, ins=False):
-               self.Text = self.Text.decode("utf-8", "ignore").decode("utf-8")
+               if isinstance(ch, str):
+                       ch = ch.decode("utf-8","ignore")
                if not pos:
                        pos = self.currPos
                if ins and not self.maxSize:
@@ -168,15 +169,15 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                if not self.maxSize:
                        self.Text = self.Text[0:pos] + self.Text[pos + 1:]
                elif self.overwrite:
-                       self.Text = self.Text[0:pos] + " " + self.Text[pos + 1:]
+                       self.Text = self.Text[0:pos] + u" " + self.Text[pos + 1:]
                else:
-                       self.Text = self.Text[0:pos] + self.Text[pos + 1:] + " "
+                       self.Text = self.Text[0:pos] + self.Text[pos + 1:] + u" "

        def deleteAllChars(self):
                if self.maxSize:
-                       self.Text = " " * len(self.Text)
+                       self.Text = u" " * len(self.Text)
                else:
-                       self.Text = ""
+                       self.Text = u""
                self.currPos = 0

        def tab(self):
@@ -186,7 +187,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
                        self.deleteAllChars()
                        self.allmarked = False
                else:
-                       self.insertChar(" ", self.currPos, False, True);
+                       self.insertChar(u" ", self.currPos, False, True);
                        self.innerright()
                self.update()


This patch fixes all encoding issues for me

 

Explanation:

 

self.Text = text.decode("utf-8", "ignore").decode("utf-8")

 

- setText function gets encoded utf-8 string, when we decode it we get unicode, if we again decode it, it will be first implicitly encoded by "ascii" encoding and then decoded to unicode. If we have some special chars which are not in ascii then there it raises UnicodeEncodeError

>>> u"ľ".decode("utf-8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u013e' in position 0: ordinal not in range(128)

So once we have unicode we don't need to decode it again, since all we get is again unicode, but with implicitly used "ascii" encoding when encoding to string

        def insertChar(self, ch, pos=False, owr=False, ins=False):
-               self.Text = self.Text.decode("utf-8", "ignore").decode("utf-8")
+               if isinstance(ch, str):
+                       ch = ch.decode("utf-8","ignore")

we have to protect input methods, since we are working with unicode, in case we get string, we have to decode it first to unicode

For example VirtualKeyboard Screen is on okClicked passing by InputText.char method string

        def getText(self):
-               return self.Text.encode("utf-8")
+               return self.Text

VirtualKeyboard is expecting that we pass unicode:

def ok(self):
		self.close(self["text"].getText().encode("UTF-8"))

If we pass string, then we are encoding string, which means we are implicitly decoding this string by "ascii" to unicode and then again to string, which could cause UnicodeDecodeError

>>> "č".encode("utf-8")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 0: ordinal not in range(128)

Othes changes are cosmetics. What do you think


Edited by mx3L, 26 February 2015 - 23:46.


Re: merge requests for PLi's git #735 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 27 February 2015 - 00:04

added patch, also added setText protection

Attached Files


Edited by mx3L, 27 February 2015 - 00:06.


Re: merge requests for PLi's git #736 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 27 February 2015 - 12:04

Pushed.... (I cannot see anything else "falls down")
 
txt.gif  0001-Input-fixed-encoding-issues.patch   2.26KB   1 downloads

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #737 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 27 February 2015 - 17:37

Thanks, unfortunately I find one sideffect which part of this change brings. Only VirtualKeyboard when using Input will encode it to string, for example InputBox will leave it in unicode. I think better way is to leave it like it was before meaning Input will return string, and just remove encoding output of Input in VirtualKeyboard.

diff --git a/lib/python/Components/Input.py b/lib/python/Components/Input.py
index 9cb2e3e..d700c25 100644
--- a/lib/python/Components/Input.py
+++ b/lib/python/Components/Input.py
@@ -69,7 +69,7 @@ class Input(VariableText, HTMLComponent, GUIComponent, NumericalTextInput):
 		self.update()
 
 	def getText(self):
-		return self.Text
+		return self.Text.encode('utf-8')
 
 	def createWidget(self, parent):
 		if self.allmarked:
diff --git a/lib/python/Screens/VirtualKeyBoard.py b/lib/python/Screens/VirtualKeyBoard.py
index f227d41..ede08f9 100644
--- a/lib/python/Screens/VirtualKeyBoard.py
+++ b/lib/python/Screens/VirtualKeyBoard.py
@@ -350,7 +350,7 @@ class VirtualKeyBoard(Screen):
 			self["text"].char(" ".encode("UTF-8"))
 
 		elif text == "OK":
-			self.close(self["text"].getText().encode("UTF-8"))
+			self.close(self["text"].getText())
 
 		elif text == "LEFT":
 			self["text"].left()
@@ -362,7 +362,7 @@ class VirtualKeyBoard(Screen):
 			self["text"].char(text)
 
 	def ok(self):
-		self.close(self["text"].getText().encode("UTF-8"))
+		self.close(self["text"].getText())
 
 	def exit(self):
 		self.close(None)



Re: merge requests for PLi's git #738 mx3L

  • Senior Member
  • 616 posts

+79
Good

Posted 27 February 2015 - 18:05

patch

Attached Files



Re: merge requests for PLi's git #739 littlesat

  • PLi® Core member
  • 56,272 posts

+691
Excellent

Posted 27 February 2015 - 21:08

Pushed

 

 

WaveFrontier 28.2E | 23.5E | 19.2E | 16E | 13E | 10/9E | 7E | 5E | 1W | 4/5W | 15W


Re: merge requests for PLi's git #740 SpaceRat

  • Senior Member
  • 1,030 posts

+65
Good

Posted 7 May 2015 - 06:34

Enable IPv6 for internal streaming:
https://github.com/o...f9c911a6f13bf80
1st box: Vu+ Ultimo 4k 4xDVB-S2 FBC / 2xDVB-C / 1.8 TB HDD / OpenATV 6.2
2nd box: Gigablue Quad 4k 2xDVB-S2 FBC / 2xDVB-C / 1.8 TB HDD / OpenATV 6.2
testing boxes: Vu+ Duo² + AX Quadbox HD2400 + 2x Vu+ Solo² + Octagon SF4008
Sats & Pay-TV: Astra 19.2°E + Hotbird 13°E with Redlight / SCT HD / SES Astra HD- / Sky V14 / 4th empire propaganda TV
Card-Server: Raspberry Pi + IPv6-capable oscam
Router: Linksys WRT1900ACS w/ LEDE + Fritz!Box 7390


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users