Modify

Opened 13 months ago

Last modified 13 months ago

#14214 new defect

Static analysis updates

Reported by: figaro Owned by: Jun Omae
Priority: low Component: TicketCalendarPlugin
Severity: normal Keywords: patch
Cc: Trac Release:

Description

Attached an update based on static analysis:

  • Added locales: de, fr, nl, sv
  • Added a few docstrings to appease pylint
  • In web_ui.py, line 317: W4902: Using deprecated method getargspec() (deprecated-method):
       if 'db' in inspect.getargspec(Query.execute)[0]:
    
    replace with?:
      if 'db' in inspect.getfullargspec(Query.execute)[0]:
    

Attachments (3)

ticketcalendarplugin.diff (9.6 KB) - added by figaro 13 months ago.
Diff -u of traccalendarplugin
locale.tar.gz (4.9 KB) - added by figaro 13 months ago.
Locales fr, de, nl and sv for ticketcalendarplugin
ticketcalendarplugin.2.diff (6.1 KB) - added by figaro 13 months ago.
Diff -ur of ticketcalendarplugin

Download all attachments as: .zip

Change History (7)

Changed 13 months ago by figaro

Attachment: ticketcalendarplugin.diff added

Diff -u of traccalendarplugin

Changed 13 months ago by figaro

Attachment: locale.tar.gz added

Locales fr, de, nl and sv for ticketcalendarplugin

comment:1 in reply to:  description Changed 13 months ago by Jun Omae

  • In web_ui.py, line 317: W4902: Using deprecated method getargspec() (deprecated-method):

Thanks. However, the plugin is not support Python 3 yet. See What’s New In Python 3.5 — Python 3.11.2 documentation.

comment:2 Changed 13 months ago by Jun Omae

I don't think it is necessary to check styling of code in the literals.

-        cursor.execute('SELECT name FROM enum WHERE type=%s'
+        cursor.execute('SELECT name FROM enum WHERE type = %s'

In my code style, doesn't put spaces around = in named parameters.

         item = tag.li(title='#%d %s' % (t.get('id'), t.get('summary')),
-                      style=style,
-                      data_href=req.href('ticketcalendar-ticket', id=tktid))
+                      style = style,
+                      data_href = req.href('ticketcalendar-ticket', id = tktid))

comment:3 Changed 13 months ago by figaro

Ok, I have dropped the spaces around the equal signs.

Changed 13 months ago by figaro

Attachment: ticketcalendarplugin.2.diff added

Diff -ur of ticketcalendarplugin

comment:4 Changed 13 months ago by Jun Omae

In 18522:

ticketcalendar: add message catalogs for de, fr, nl and sv locales (refs #14214)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain Jun Omae.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.