Springen naar inhoud


Foto

Instant recording (with custom duration) faulty in nightly build


  • Please log in to reply
Er zijn 81 reacties in dit onderwerp

Re: Instant recording (with custom duration) faulty in nightly build #21 Dimitrij

  • PLi® Core member
  • 10044 berichten

+339
Excellent

Geplaatst op 19 augustus 2023 - 16:34

>>> a = ' 5 5 '
>>> a.strip()
'5 5'
>>> int(a.strip())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for int() with base 10: '5 5'
>>> a = ' 5 5 '
>>> int(a.replace(" ", ""))
55
>>>

 


Veranderd door Dimitrij, 19 augustus 2023 - 16:36

GigaBlue UHD Quad 4K /Lunix3-4K/Solo 4K


Re: Instant recording (with custom duration) faulty in nightly build #22 WanWizard

  • PLi® Core member
  • 68796 berichten

+1743
Excellent

Geplaatst op 19 augustus 2023 - 17:03

Yes, I understand the difference.

 

My question is how on earth is this valid input? And who inputs this, you have to bend over backwards go get a space in there, let alone three...


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Instant recording (with custom duration) faulty in nightly build #23 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 19 augustus 2023 - 17:40

As I saw, for Input box has definition of default text and length in one. In this case used text="5  " means 5 minuts as default number and length 3 chars. And user, unfortunately, can in this input box with < and > move cursor and then set f.eg. "5 1"... due it using useableChars is for nothing.

And then .replace(" ", "") is simplest way of fixing it (may be used  "".join(text.split() too, but why ...) 


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #24 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 19 augustus 2023 - 18:15

Instill do not understand why we get space 5 space 5 and then we need to make it 55? What is this about? Can’t it be resolved at the input by not allowing unusable characters instead of work-a-round it afterwards… somehow they are already replaced by spaces?


Veranderd door littlesat, 19 augustus 2023 - 18:19

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


Re: Instant recording (with custom duration) faulty in nightly build #25 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 19 augustus 2023 - 18:20

read once again my first line ...

text="5  "   => input length is 3, default text is "5  ".  User then can use ">"  (keys for edit, it cannot be disabled) and type 1  => "5 1"


Veranderd door ims, 19 augustus 2023 - 18:23

Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #26 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 19 augustus 2023 - 18:22

I did indeed… with strip you remove already the extra spaces. But when the field should be a number than arrange that is could only be a number… and arrange that at the input you cannot get spaces at all… solve the cause instead of hiding the symptom.


Veranderd door littlesat, 19 augustus 2023 - 18:24

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


Re: Instant recording (with custom duration) faulty in nightly build #27 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 19 augustus 2023 - 18:27

then must be rebuilded whole input box in E2 ... user cannot add spaces, he can type numbers only, but spaces are there as definition field length and user can move cursor to end and type number.

 

btw - strip(char) removing char on start or on end ...


Veranderd door ims, 19 augustus 2023 - 18:29

Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #28 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 19 augustus 2023 - 19:38

Yep indeed strip is start and end. But there should be no space in the middle and indeed the input stuff needs revision… maybe add parameter that a number is expected? The original code here still comes from DMMs ‘attic’. When you expect to enter numbers you should not have spaces in between….’and 5 space 5 is actually bad input…. This should be made impossible. Why is it ‘fixed’ on three characters is also crazy..

Veranderd door littlesat, 19 augustus 2023 - 19:42

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


Re: Instant recording (with custom duration) faulty in nightly build #29 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 19 augustus 2023 - 19:56

The InputBox is an old text field. You can specify which characters are accepted during input, but once you delete something, spaces are inserted there anyway. Even entering something like text="005" doesn't help. Try it.


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #30 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 19 augustus 2023 - 20:05

it could be fixed in InputBox:

	def go(self):
+		if self.useableChars and " " not in self.useableChars:
+			self.close(self["input"].getText().replace(" ",""))
+		else:
			self.close(self["input"].getText())

and in InstantRecording in call InputBox add

useableChars='0123456789' 

 

 

 
 
 


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #31 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 20 augustus 2023 - 07:57

Again work a round… unless it might work. The issue is that you reserved 3 characters for the input… so it starts with “   “. Why? You want to enter a number…. It should not have length of string… maybe only when we want a max number…

as far I know in config stuff we have number options… use that instead?


Veranderd door littlesat, 20 augustus 2023 - 07:57

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


Re: Instant recording (with custom duration) faulty in nightly build #32 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 20 augustus 2023 - 08:44

Once you set a fixed length (maxSize=True), the field length is determined by the length of the string 'text,' and it cannot be changed.
So, without spaces (text="5"), only a single-digit number will be accepted. Because that's how the InputBox works.

We can call InputBox with: text="5", maxSize=False. Then it will be without spaces, but then is not limited length of typed number. Does the size of the number need to be limited?

PR is created on github.

 


Veranderd door ims, 20 augustus 2023 - 09:04

Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #33 Stan

  • Senior Member
  • 346 berichten

0
Neutral

Geplaatst op 20 augustus 2023 - 12:48

Werbezapper uses this inputbox too. It has maxSize=False and crashes with long inputs.

 

Is there really no suited input mask that can be used instead?



Re: Instant recording (with custom duration) faulty in nightly build #34 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 20 augustus 2023 - 12:56

Sounds like InputBox need a real revision/fix to allow to enter numbers (integers). instead of work-a-round and work-a-round work-a-rounds… for me at least no it is clear what is going on here… doing 5 space 5 should be made impossible here. So doing > when you have numbers only and you skip a space is also something you can do to make this not possible… if type is a number…

Veranderd door littlesat, 20 augustus 2023 - 13:02

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


Re: Instant recording (with custom duration) faulty in nightly build #35 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 20 augustus 2023 - 13:07

maxsize=False is not work-a-round ... I give up...


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #36 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 20 augustus 2023 - 14:30

Add feature to enter number to InputBox is a fix

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


Re: Instant recording (with custom duration) faulty in nightly build #37 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 20 augustus 2023 - 14:44

If you want rebuild string inputBox, you have the option... InputBox.py, respective Input.py
Btw - I dont know, who merged my PR, but it seems, it is merged...


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #38 WanWizard

  • PLi® Core member
  • 68796 berichten

+1743
Excellent

Geplaatst op 20 augustus 2023 - 14:59

I did. Shouldn't I have done that?


Currently in use: VU+ Duo 4K (2xFBC S2), VU+ Solo 4K (1xFBC S2), uClan Usytm 4K Pro (S2+T2), Octagon SF8008 (S2+T2), Zgemma H9.2H (S2+T2)

Due to my bad health, I will not be very active at times and may be slow to respond. I will not read the forum or PM on a regular basis.

Many answers to your question can be found in our new and improved wiki.


Re: Instant recording (with custom duration) faulty in nightly build #39 ims

  • PLi® Core member
  • 13626 berichten

+212
Excellent

Geplaatst op 20 augustus 2023 - 15:06

I did. Shouldn't I have done that?

It can be ...


Kdo nic nedělá, nic nezkazí!

Re: Instant recording (with custom duration) faulty in nightly build #40 littlesat

  • PLi® Core member
  • 56417 berichten

+692
Excellent

Geplaatst op 23 augustus 2023 - 12:58

I just tried to verify the issue with the 5 space 5... but I tried with instant recording but I was not able to get it. How did you arrange to get 5 space 5... I can't.


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



3 gebruiker(s) lezen dit onderwerp

0 leden, 3 bezoekers, 0 anonieme gebruikers