• Balur

    @DavidHutchison Thank you again. With SKIP_FILES collection, can complete folders be skipped without add file by file? Config file is a good direction. I'm definitely looking forward to it.

    Yesterday I also found two more issues about empty folders and re-uploading deleted files.

    posted in Pythonista read more
  • Balur

    @DavidHutchison Thank you for your update. I tested in my enviroment and I bumped into 2 issues.

    posted in Pythonista read more
  • Balur

    @upwart I know there is a better approach, but I did the following 3 line modifications:

    Add this line top level, around line 20:
    FILE_FILTER = ('.py','.pyui','.txt')

    Replace line 122:
    before: if file['is_dir'] == False and file['mime_type'].endswith('python'):
    after: if file['is_dir'] == False and file['path'].endswith(FILE_FILTER):

    Replace line 250:
    before: if not file in processed_files and not os.path.isdir(file) and not file.startswith('.') and file.endswith('.py'):
    after: if not file in processed_files and not os.path.isdir(file) and not file.startswith('.') and file.endswith(FILE_FILTER):

    @ccc Thank you for opening an issue about nested folders, hope someone will pick it up soon.

    posted in Pythonista read more
  • Balur

    @ccc It's upload only .py files, and only in one folder deep. Is this working as expected?

    1. Sketchpad/HelloWorld.py
    2. Projects/RandomThing/RandomThing.py

    First file uploaded, second not. Pyui files and .txt neither.

    I find where can I add more file type to the jam, but not the nested directories.

    posted in Pythonista read more
  • Balur

    @ccc Am I have the right one? I think not. I am currently using freekrai's version. You mean what I linked last, dhutchison's repo?

    Really sorry I have issue with English as well.

    I gave a quick look at dhutchison's DropboxSync. I had problem with it, because it's only sync very few files. Do it have any limitation?

    posted in Pythonista read more
  • Balur

    @ccc Edited. Tried my best.

    posted in Pythonista read more
  • Balur

    @ccc I read this, thanks for mentioning. GitHub, collaboration, fostered code etc are totally new to me, so I'm a bit puzzled. Which one you prefer or suggest? This one?

    posted in Pythonista read more
  • Balur

    @Phuket2 Too many keyboards yes. I give MS keyboard a try, I read some good review. If it fails me, I'll request a refund and move along.

    posted in General Discussion read more
  • Balur

    @omz @Webmaster4o Well done, works for me too.

    @JonB Thank you, I extended the functions based on your answer. If you find something about 1/3 screen console, please let me know.

    # coding: utf-8
    import ui
    import objc_util
    
    def getDefaultConsoleFont():
        defaults=objc_util.ObjCClass('NSUserDefaults').standardUserDefaults()
        return (str(defaults.stringForKey_('OutputFontName')),\
                defaults.integerForKey_('OutputFontSize'))
    
    def getCurrentConsoleFont():
        app=objc_util.ObjCClass('UIApplication').sharedApplication()
        cv=app.delegate().consoleViewController()
        cv.view()
        font=cv.outputFont()
        font_family=str(font.familyNameForCSSFontFamilyValue())
        #font_family2=str(font.familyName())
        font_size=font.pointSize()
        char_width=font.advancementForGlyph_(68).width
        line_height=font.lineHeight()
        return (font_family, font_size), char_width, line_height
    
    def getConsoleCharWidth():
        font,charWidth,lineHeight=getCurrentConsoleFont()
        screenWidth=ui.get_screen_size().width
        #charWidth=ui.measure_string('.',font=font).width
        return int(screenWidth / charWidth-1.5) 
    
    if __name__ == '__main__':
        ccwidth=getConsoleCharWidth()
        currentFont,_,_=getCurrentConsoleFont()
        defaultFont=getDefaultConsoleFont()
        print('currentConsoleFont='+str(currentFont))
        print('defaultConsoleFont='+str(defaultFont))
        print('consoleCharWidth = '+str(ccwidth))
        print('='*ccwidth)
    

    Sorry for copy paste, it's a bit long.

    posted in Pythonista read more
  • Balur

    @Webmaster4o, Oh , that's unfortunate.

    @marcus67, I have a NAS with WebDAV service. I'll check your link soon. Thank you.

    posted in Pythonista read more
  • Balur

    @Phuket2, I don't want cover keyboard. I have a pouch case, that is fine for me. Plus I'd like to pair with multiple device. Seperate keyboard or with some kind of built in stand. Orientation is not decided yet, because I never have a bt keyboard, but maybe landscape.

    posted in General Discussion read more
  • Balur

    I don't have any bluetooth keyboard yet. I'd like to get one.

    After a quick google search, Microsoft Universal Mobile Keyboard popped up a lot.
    Anyone using it? It is that great, pros and cons? Or do you suggest something else?
    Please let me know.

    posted in General Discussion read more
  • Balur

    Just a little thing I know, but...
    Is it possible to mute top keys and code completion sounds without poke the vibrate switch?

    posted in Pythonista read more
  • Balur

    Hi there,

    I wonder how do you guys sync your files between devices?

    I'm actually using freekrai's DropboxSync.py with some minor tweeks to get the job done.
    Do you have a better or simpler solution? I hope sync will be a future builtin feature.

    posted in Pythonista read more
  • Balur

    @JonB Strange, but it's do the job. One little problem for me is how to access the values one by one, not this UICTFont object thing?

    getConsoleWidth() is still not perfect when I run on ipad when pythonista editor and console are side by side. Because of ui.get_screen_size().width returns the full screen size, not just the console size. I have to subtrack the editor panel width from the full screen size. Or something like that. Any suggestion?

    posted in Pythonista read more
  • Balur

    @JonB, The current font block of code prints None for me. The default font one is working and printing 'Menlo-Regular', 12. Which is strange because I not changed my font at all, and it's not 12 but 14.

    posted in Pythonista read more
  • Balur

    I think I got the missing piece. After a little testing it seems the default console font is Menlo, 14.

    import ui
    def getConsoleWidth(font=('Menlo',14)):
      screenWidth = ui.get_screen_size().width
      charWidth = ui.measure_string('.',font=font).width
      return int(screenWidth / charWidth-1.5)
    

    I'm not sure why subtract by 1.5 exactly, but I think console margin have something to do with it. Tested on my iphone and ipad mini, both orientations.

    posted in Pythonista read more
  • Balur

    @Phuket2, You are right. Actually, I just want how many chars per line. Maybe a silly approach, but I want my scripts' welcome text underlined with a full line of chars.

    consoleWidth = getConsoleWidth() # <= 50 
    print('DownloadFromWeb')
    print('Give me an URL, and I will download it for you.')
    print('='*consoleWidth)
    

    It looks like this in console:

    DownloadFromWeb
    Give me an URL, and I will download it for you.
    =================================================

    @Phuket2, I don't want to change console font. Default is good for now. What is the default console font? measure_string() seems a good approach.

    posted in Pythonista read more
  • Balur

    Okay, I got the screen size:

    import ui
    width, height = ui.get_screen_size()
    

    But how can I get the main console object?

    posted in Pythonista read more
  • Balur

    Hi Guys,

    I'm new here and new to Python language also.
    Is there any working way to get console width in Pythonista? I mean in character count in one row, like 40 or 36.

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!